In a perfectly competitive market, the firm's demand curve is the firm's marginal revenue curve. The firm maximizes profits by producing where MR = MC.