Derives optimal capital stock when longevity is endogenous.