Demand and cost analysis (Profit maximization)