How to calculate minimization of cost when given the marginal revenue