profit maximization using total cost and total revenue curves