From Demand to an Optimization Model
A demand model describes how the price a business can charge depends on the quantity it sells. In this tutorial, \(q\) denotes quantity sold and \(p(q)\) denotes the price per unit when \(q\) units are sold. A cost model \(C(q)\) gives the total cost of producing that quantity. The goal is to use these relationships to find the feasible quantity that produces the greatest revenue or profit.
Economic quantities have a useful distinction: price is earned on each unit, while revenue is earned across all units sold. Cost must then be accounted for before deciding which quantity is most profitable. The best quantity therefore depends not just on the demand curve, but also on the cost function and on which quantities are actually feasible.
If quantity is measured in items and price in dollars per item, then \(R(q)\) and \(C(q)\) are measured in dollars. Profit can be negative: a negative value means that the modeled cost exceeds revenue. Depending on the situation, \(q=0\) may also be feasible, and a capacity or a nonnegative-price condition may limit the quantity further.
Why Revenue Has This Form
Suppose each of \(q\) units sells for \(p(q)\) dollars. Multiplying the number of units by the price per unit gives total sales revenue. Because the price may change as the quantity changes, revenue is a function of \(q\), not simply a constant price times quantity.
When \(p\) is differentiable, the product rule gives a useful expression for the rate of change in revenue:
The term \(p(q)\) is the additional revenue from selling one more unit at the current price, considered on its own. The term \(q\,p'(q)\) accounts for the price change that accompanies a change in quantity. For a decreasing demand function, \(p'(q)<0\), so this second term is negative: selling more may require lowering the price.
Profit changes at the rate \(R'(q)-C'(q)\). At an interior differentiable profit maximum, the derivative must be zero. Thus the relevant equation is \(R'(q)=C'(q)\), provided the candidate is feasible and the conditions for an interior maximum are met. This equation is a candidate condition, not a guarantee: the quantity must still be checked against the feasible domain and compared with other candidates.
Worked Example: Maximizing Revenue with Linear Demand
Worked Example: Maximizing Revenue with Linear Demand
A seller’s price-demand relationship is \(p(q)=100-2q\) dollars per unit. Assume quantities are continuous and feasible for \(0\le q\le50\), so the modeled price is nonnegative. Find the quantity that maximizes revenue and check the result.
Revenue is quantity times price:
Differentiate and set the derivative equal to zero to find an interior candidate:
The candidate lies in the feasible interval. Check it against both endpoints:
The candidate gives the greatest of these values. Also, \(R''(q)=-4<0\), so the revenue graph is concave down throughout the interval. Therefore \(q=25\) maximizes revenue on the entire feasible interval. At that quantity the price is \(p(25)=100-2(25)=50\) dollars per unit, and the revenue check is \(25(50)=1250\) dollars.
Finally, differentiating the stated revenue function gives \(\frac{d}{dq}(100q-2q^2)=100-4q\), as used above.
Profit Requires Subtracting Cost
A revenue maximum is not automatically a profit maximum. Producing and selling more can increase revenue while increasing cost even faster. To optimize profit, first subtract total cost from total revenue, then optimize the resulting function on its feasible domain.
Worked Example: Finding an Interior Profit Maximum
Suppose \(p(q)=80-q\) dollars per unit and \(C(q)=200+8q+q^2\) dollars. Use the feasible interval \(0\le q\le80\), where demand price is nonnegative. Find the profit-maximizing quantity and verify it.
First construct revenue and profit:
Differentiate profit and solve for an interior candidate:
To compare with the endpoints, calculate:
The interior candidate has the greatest profit. Since \(\Pi''(q)=-4<0\), profit is concave down, confirming that \(q=18\) is the maximum on the interval. To interpret it, the price is \(p(18)=80-18=62\) dollars per unit, revenue is \(R(18)=18(62)=1116\) dollars, and cost is \(C(18)=200+8(18)+18^2=200+144+324=668\) dollars. Subtracting gives \(1116-668=448\) dollars of profit.
The marginal-revenue and marginal-cost calculation agrees: \(R'(q)=80-2q\), so \(R'(18)=80-36=44\); \(C'(q)=8+2q\), so \(C'(18)=8+36=44\). Both derivatives are equal at the interior candidate. Differentiating the profit function also checks the calculation: \(\frac{d}{dq}(72q-2q^2-200)=72-4q\).
Why the Marginal Condition Works
The condition for an interior profit maximum follows directly from how revenue and cost combine. Since \(\Pi(q)=R(q)-C(q)\), differentiating gives \(\Pi'(q)=R'(q)-C'(q)\). At an interior local maximum of a differentiable function, its derivative is zero. Consequently, at such a profit maximum, \(R'(q)-C'(q)=0\), which rearranges to \(R'(q)=C'(q)\).
This argument explains both the usefulness and the limit of the condition. It identifies possible interior maxima, but it does not apply to an optimum occurring at an endpoint, and it does not establish that every solution is a maximum. A solution might be a minimum, might fall outside the feasible domain, or might give less profit than another candidate. The model’s actual feasible quantities determine which comparisons are needed.
Using the demand function, the same condition can be written as \(p(q)+q\,p'(q)=C'(q)\). The left side is the derivative of revenue; the right side is the derivative of cost. This form makes clear why the price alone is not the revenue gained from one additional unit: the change in price on existing sales is also included.
Worked Example: A Capacity-Bound Profit Maximum
Worked Example: A Capacity-Bound Profit Maximum
Suppose \(p(q)=60-2q\) dollars per unit, \(C(q)=12q+q^2\) dollars, and production is limited to \(0\le q\le6\). Find and verify the feasible profit-maximizing quantity.
Revenue and profit are:
Differentiate profit:
Solving \(\Pi'(q)=0\) gives \(q=8\), which is outside the feasible interval \(0\le q\le6\). In fact, for every feasible \(q\), \(48-6q\ge48-36=12>0\), so profit is increasing throughout the interval. The maximum is therefore at the upper endpoint, \(q=6\). Comparing endpoint values confirms the result:
At \(q=6\), the price is \(60-2(6)=48\) dollars per unit, revenue is \(6(48)=288\) dollars, and cost is \(12(6)+6^2=72+36=108\) dollars. Thus profit is \(288-108=180\) dollars. Differentiating the profit expression verifies \(\Pi'(q)=48-6q\); because this derivative stays positive on the feasible interval, there is no feasible interior critical point to compare.
A Common Mistake: Optimizing Revenue Instead of Profit
In the interior-profit example, revenue alone is \(R(q)=80q-q^2\). Its derivative is \(R'(q)=80-2q\), which is zero at \(q=40\). That is the revenue-maximizing quantity for the stated demand model, but it is not the profit-maximizing quantity.
At \(q=40\), price is \(80-40=40\) dollars per unit and revenue is \(40(40)=1600\) dollars. Cost is \(200+8(40)+40^2=200+320+1600=2120\) dollars, so profit is \(1600-2120=-520\) dollars. By comparison, producing \(18\) units gives profit \(448\) dollars. The error is treating a revenue maximum as though costs did not matter. The correction is to form \(\Pi(q)=R(q)-C(q)\) before differentiating when the objective is profit.
A Reliable Model-to-Answer Process
Use the stated production limits, nonnegative quantities, and any demand-price restrictions to determine where the model applies.
Calculate \(R(q)=q\,p(q)\). If the goal is profit, subtract the full cost function: \(\Pi(q)=R(q)-C(q)\).
For an interior differentiable candidate, solve \(R'(q)=0\) for revenue or \(\Pi'(q)=0\) for profit. Discard solutions outside the feasible domain.
Check feasible endpoints and candidates, then report the maximizing quantity and the requested price, revenue, cost, or profit with appropriate units.
This process treats the quantity as a continuous variable, as is standard in calculus models. If a real application permits only whole-number quantities, a continuous optimum may not itself be attainable; the relevant feasible integer quantities must then be compared. In every case, the final answer must respect the model’s domain rather than merely solve a derivative equation.
Check Your Understanding
For each question, state the objective and respect the feasible domain before concluding.
- If \(p(q)=50-q\), what revenue function follows from the demand model?
- If revenue is \(R(q)\) and cost is \(C(q)\), write the profit function and its derivative.
- Why does an interior differentiable profit maximum satisfy \(R'(q)=C'(q)\)?
- A derivative equation gives a candidate outside the capacity interval. Can that quantity maximize profit in the stated model? Explain.
- Why might the quantity that maximizes revenue differ from the quantity that maximizes profit?