Marginal cost function and total cost