revenue maximization and profit maximization for a monopolist given demand and cost function