We examine the role of investment opportunities on the marginal cost of a backstop technology and the resulting implications for optimal depletion of a non-renewable resource. We consider the case in which two economic agents (individuals, cities, or nations) compete for a non-renewable resource, and investments in research and development will reduce the marginal cost of a backstop technology. We examine the problem in both social optimization and game theory frameworks. We consider three scenarios: 1) The social planner's problem in which the sum of net benefits earned by the two agents (players) is maximized, 2) A scenario in which two players compete for the limited resource, while making investments jointly, and 3) A scenario in which the players compete for the resource and they choose investment levels independently. We examine, in particular, the case of groundwater withdrawals from an aquifer with a very small rate of natural recharge. The backstop technology is desalination. Results describe the optimal paths of investments in knowledge, as the original stock of groundwater is depleted. Groundwater is extracted over a longer interval, and the sum of investments in knowledge is smallest, in the social planner's scenario.