Profit equals total revenue minus total cost. Given businesses want to maximize profit, they should keep producing more output as long as an additional unit adds more to revenue than it adds to cost. Economists call the added revenue marginal revenue and the added cost marginal cost. Thus, firms should continue producing more output until marginal revenue equals marginal cost. That’s the point where profits are maximized.

Marginal revenue can be a little tricky. In order to sell more output, firms frequently have to lower price. This lower price means the firm gets less revenue not only for the last unit, but all other units produced, because firms usually charge the same price for every unit they sell. In this situation, the last unit’s marginal revenue equals its price minus the decrease in revenue that occurs because a lower price is charged for every other unit. The crucial point you need to remember is that marginal revenue in this situation is less than price.

Marginal revenue and marginal cost can be determined with calculus. Because marginal revenue is the change in total revenue that occurs when an additional unit of output is produced and sold, marginal revenue is the derivative of total revenue taken with respect to quantity. Similarly, marginal cost is the change in total cost that occurs when one additional unit of a good is produced, so it’s the derivative of total cost taken with respect to quantity. You can determine the profit-maximizing quantity of output by setting these two derivatives equal to one another.