The optimal use of non-renewable resources: The theory of extraction