Case Study 2 — Marginal Analysis: How a Firm Finds Its Best Output
Field: Microeconomics Calculus used: The derivative as a marginal (per-unit) rate of change, computed from the limit definition; interpretation of the derivative across a field (Sections 5.2, 5.8)
The decision every producer faces
A small manufacturer makes precision widgets. Each morning the plant manager must answer a single deceptively simple question: how many widgets should we make today? Make too few and the fixed costs of running the plant — rent, salaried staff, machine depreciation — are spread thin over too little output, and easy profit is left on the table. Make too many and the firm is forced to discount heavily to move the extra units, while the cost of each additional widget climbs as overtime, raw-material premiums, and crowded machines bite. Somewhere between "too few" and "too many" lies a best quantity. The tool that finds it is the derivative — read here not as a slope or a velocity, but as a marginal rate (Section 5.8).
We are told three things about the business.
Total cost of producing $q$ widgets per day: $$C(q) = 1000 + 5q + 0.01q^2 \quad \text{(dollars)}.$$ The $\$1000$ is fixed cost (paid even at $q = 0$); the $5q$ is a baseline per-unit cost; the $0.01q^2$ term makes each successive unit a little more expensive than the last — the mathematical signature of diminishing returns.
Price the market will pay when the firm offers $q$ units (a downward-sloping demand curve — to sell more, you must charge less): $$p(q) = 50 - 0.05q.$$
Total revenue is price times quantity: $$R(q) = p(q)\cdot q = (50 - 0.05q)\,q = 50q - 0.05q^2.$$
Profit is revenue minus cost: $$\pi(q) = R(q) - C(q) = (50q - 0.05q^2) - (1000 + 5q + 0.01q^2) = 45q - 0.06q^2 - 1000.$$
The plant manager wants the $q$ that makes $\pi(q)$ as large as possible.
"Marginal" means "derivative"
A century and a half ago, economists discovered that the right way to think about this is not in totals but in margins — the effect of one more unit. The marginal cost is the rate of change of total cost with respect to quantity, which is precisely the derivative $C'(q)$. Let us compute it the honest Chapter-5 way, straight from the limit definition (Section 5.2), with no power rule:
$$C'(q) = \lim_{h \to 0} \frac{C(q+h) - C(q)}{h}.$$
The fixed $\$1000$ cancels (it does not depend on $q$). The linear term contributes $5(q+h) - 5q = 5h$. The quadratic term contributes
$$0.01\big[(q+h)^2 - q^2\big] = 0.01\big(2qh + h^2\big).$$
Assemble and divide by $h$ (legal, since $h \neq 0$ inside the limit):
$$\frac{C(q+h) - C(q)}{h} = \frac{5h + 0.01(2qh + h^2)}{h} = 5 + 0.02q + 0.01h.$$
Let $h \to 0$ and the last term vanishes:
$$\boxed{\,C'(q) = 5 + 0.02q\,}.$$
This is the marginal cost: when the firm is already making $q$ widgets, the next widget costs approximately $C'(q)$ dollars. At $q = 100$ it is $5 + 2 = \$7$; at $q = 400$ it is $5 + 8 = \$13$. The cost of "one more" rises as the plant gets busier — diminishing returns made quantitative.
The same limit computation (which we will soon do in a single line with the rules of Chapter 7) gives the other two marginal functions:
$$R'(q) = 50 - 0.10q \quad (\textbf{marginal revenue}), \qquad \pi'(q) = R'(q) - C'(q) = 45 - 0.12q \quad (\textbf{marginal profit}).$$
Marginal revenue starts high — the very first widget can be sold near $\$50$ — and falls, because flooding the market depresses the price for all units, not just the last one.
Finding the optimum: set the marginal rate to zero
Here is the calculus payoff. Profit stops rising and starts falling exactly when its rate of change crosses zero — when the marginal profit $\pi'(q)$ equals $0$. (At a peak, the tangent to the profit curve is horizontal; Section 5.3 told us a horizontal tangent has slope $0$, and Section 5.8 told us that slope is the rate of change.) So:
$$\pi'(q) = 45 - 0.12q = 0 \quad\implies\quad q^* = \frac{45}{0.12} = 375 \text{ widgets}.$$
The profit at that output is
$$\pi(375) = 45(375) - 0.06(375)^2 - 1000 = 16{,}875 - 8{,}437.5 - 1{,}000 = \$7{,}437.50.$$
There is a second, more illuminating way to read the same answer. At $q^* = 375$,
$$C'(375) = 5 + 0.02(375) = \$12.50/\text{widget}, \qquad R'(375) = 50 - 0.10(375) = \$12.50/\text{widget}.$$
Marginal cost equals marginal revenue. This is the single most famous condition in microeconomics — "produce until $MC = MR$" — and you can now see it is nothing exotic: it is just $\pi'(q) = R'(q) - C'(q) = 0$ rewritten. The firm should keep producing as long as the next widget brings in more than it costs ($MR > MC$), and stop the instant that advantage disappears ($MR = MC$).
import numpy as np
import matplotlib.pyplot as plt
q = np.linspace(0, 500, 300)
C = 1000 + 5*q + 0.01*q**2
R = 50*q - 0.05*q**2
profit = R - C
Cp = 5 + 0.02*q # marginal cost C'(q)
Rp = 50 - 0.10*q # marginal revenue R'(q)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(13, 4))
ax1.plot(q, C, label='Total cost C(q)')
ax1.plot(q, R, label='Total revenue R(q)')
ax1.plot(q, profit, label='Profit π(q)')
ax1.axvline(375, color='gray', ls='--', label='q* = 375')
ax1.set_xlabel('Quantity q'); ax1.set_ylabel('Dollars'); ax1.legend(); ax1.grid(alpha=0.3)
ax1.set_title('Totals: profit peaks at q* = 375')
ax2.plot(q, Cp, label="Marginal cost C'(q)")
ax2.plot(q, Rp, label="Marginal revenue R'(q)")
ax2.axvline(375, color='gray', ls='--'); ax2.plot(375, 12.5, 'ko')
ax2.set_xlabel('Quantity q'); ax2.set_ylabel('$ per widget'); ax2.legend(); ax2.grid(alpha=0.3)
ax2.set_title('Margins: MC = MR = $12.50 at q* = 375')
plt.tight_layout(); plt.show()
# The crossing of marginal cost and marginal revenue (right) sits directly
# below the peak of the profit curve (left). Same point, two views.
Is it really a maximum? The second derivative
Setting $\pi'(q) = 0$ finds a critical point, but a horizontal tangent can sit atop a hill or at the bottom of a valley. The second derivative (Section 5.5) decides. Differentiating $\pi'(q) = 45 - 0.12q$ once more — from the definition, this is the derivative of a linear function, whose slope is its coefficient (Section 5.9) — gives
$$\pi''(q) = -0.12 < 0.$$
A negative second derivative means the marginal profit is decreasing through the critical point: profit is rising before $q^*$ and falling after, so $q^* = 375$ is genuinely a maximum. (We will formalize this as the second-derivative test in Chapter 9.) The sign of $\pi''$ here is the same concavity information that, in physics, distinguished speeding up from slowing down — one mathematical object, many costumes.
Why this generalizes
The structure we just used is not special to widgets. Whenever a decision-maker asks "how much should I do?", the optimal answer equates a marginal benefit with a marginal cost, and each "marginal" quantity is a derivative.
- A firm choosing how many workers to hire stops where the marginal product of labor equals the wage.
- A consumer allocating a budget buys each good until the marginal utility per dollar is equal across all goods.
- An investor sizing positions weights assets until marginal expected return per unit of risk is equalized.
In every case the recipe is identical and is exactly what this chapter built: form the rate of change (the derivative), set it to zero, and check the second derivative for a maximum. The recurring theme of the book — calculus appears in every quantitative field — is nowhere more visible than here, where the abstract limit of Section 5.2 becomes a daily production decision.
The Key Insight. Modern economics runs on derivatives. "Marginal cost," "marginal revenue," and "marginal utility" are not metaphors — each is literally $\frac{d}{dq}$ of a total. Once you read "$MC = MR$" as "$\pi'(q) = 0$," the calculus of the firm becomes routine.
Discussion Questions
- The marginal cost $C'(q) = 5 + 0.02q$ rises linearly with $q$. What real production phenomenon does an increasing marginal cost model? (Diminishing returns: the most efficient resources are used first; later units draw on costlier overtime, premium materials, and crowded equipment.)
- Why doesn't the firm simply maximize total revenue, or minimize total cost? Compute where each of those occurs and explain why neither maximizes profit. (Revenue peaks at $q = 500$; cost is least at $q = 0$; profit balances the two and peaks between them, at $375$.)
- Suppose the firm is in perfect competition and cannot influence price, so $p$ is a constant. Then $R(q) = pq$ and $R'(q) = p$. Show that the profit-maximizing rule collapses to the textbook condition "$P = MC$."
- The optimum required $\pi''(q) < 0$. Construct a profit function with a critical point that is a minimum instead, and explain how the second derivative flags the difference.
- In data-driven economics, $C(q)$ and $p(q)$ are not handed to you — they must be estimated from messy historical data. Sketch how you might fit a marginal cost curve from records of output and expense, and what could go wrong (noise, regime changes, extrapolation beyond observed $q$).
Your Turn — Mini-Project
A firm has cost $C(q) = 100 + 4q + 0.005q^2$ and faces demand $p(q) = 40 - 0.02q$.
- Find marginal cost $C'(q)$ from the limit definition, then write $R(q) = p(q)\,q$ and find $R'(q)$.
- Solve $C'(q) = R'(q)$ for the profit-maximizing quantity $q^*$.
- Compute the optimal price $p(q^*)$ and the maximum profit $\pi(q^*)$.
- Verify with the second derivative that $q^*$ is a maximum, and plot $C, R$ on one axis and $C', R'$ on another.
This is the micro-foundation of how a single firm sets output. Chapter 10 treats such optimization systematically; Chapter 31 extends it to multi-product firms using the multivariable derivatives built in Chapter 30; and Chapter 19 makes it dynamic, choosing output over many periods at once.
Further Reading
- Mankiw, N. G. (2018). Principles of Economics (8th ed.). Cengage. Chapters 13–14 develop cost curves and the $MC = MR$ rule at the introductory level, with the economics kept central and the calculus light — a good first encounter.
- Varian, H. R. (2014). Intermediate Microeconomics (9th ed.). W. W. Norton. The standard intermediate text; marginal analysis is done explicitly with derivatives throughout, exactly as in this case study.
- Marshall, A. (1890). Principles of Economics. Free via the Library of Economics and Liberty. The book that introduced marginal analysis to English-speaking economics; read the "principle of substitution" sections for the historical origin of "$MC = MR$."
- Mas-Colell, A., Whinston, M. D., & Green, J. R. (1995). Microeconomic Theory. Oxford University Press. Graduate-level and calculus-heavy; consult once you have the multivariable tools of Part VI for the rigorous, general statement of the firm's problem.