Demand functions and marginal revenue