Sub topic 11
Worked example with numbers
This chapter applies the MR = MC rule to one firm from start to finish. It assumes you can solve linear equations, read a demand curve, and take a simple derivative. You should already know what marginal revenue, marginal cost and the shutdown rule mean from earlier chapters. Here you will compute everything and check it three ways.
The setup
A firm sells a product with this inverse demand curve and cost function:
- Inverse demand: P = 100 − 2Q
- Total cost: C = 50 + 20Q + Q²
Fixed cost is 50. Variable cost is 20Q + Q², so marginal cost rises as output rises. The firm faces a downward-sloping demand curve, so it must lower the price on every unit to sell one more.
The functions we need are:
| Quantity | Formula |
|---|---|
| Total revenue, TR | (100 − 2Q)Q = 100Q − 2Q² |
| Marginal revenue, MR | dTR/dQ = 100 − 4Q |
| Total cost, TC | 50 + 20Q + Q² |
| Marginal cost, MC | dTC/dQ = 20 + 2Q |
| Profit, π | TR − TC = −3Q² + 80Q − 50 |
MR has twice the slope of demand. This is the "MR lies below price" result from the previous chapter. At Q = 10, price is 80 but MR is only 60.
Step 1: Solve MR = MC
Set the two marginal functions equal:
100 − 4Q = 20 + 2Q
80 = 6Q
Q* = 13.33
Step 2: Read the price off demand
MR = MC gives the quantity, not the price. The firm charges the highest price at which buyers will take Q*, and that price comes from the demand curve:
P* = 100 − 2(13.33) = 73.33
A common error is to substitute Q into the MR or MC function and call the result the price. At Q both equal 46.67, which is well below the price of 73.33. The gap is the markup the firm earns from its market power.
Step 3: Compute profit
- TR = 73.33 × 13.33 = 977.78
- TC = 50 + 20(13.33) + 13.33² = 50 + 266.67 + 177.78 = 494.44
- π = 977.78 − 494.44 = 483.33
The next code block repeats these steps and prints the same numbers.
# Inverse demand: P = a - b*Q. Cost: C = f + c*Q + d*Q**2
a, b = 100, 2
f, c, d = 50, 20, 1
def revenue(q): return (a - b * q) * q
def cost(q): return f + c * q + d * q**2
def profit(q): return revenue(q) - cost(q)
def mr(q): return a - 2 * b * q # derivative of revenue
def mc(q): return c + 2 * d * q # derivative of cost
# Solve MR = MC: a - 2bQ = c + 2dQ
q_star = (a - c) / (2 * b + 2 * d)
p_star = a - b * q_star
print(round(q_star, 2), round(p_star, 2), round(profit(q_star), 2))
# 13.33 73.33 483.33
print(round(mr(q_star), 2), round(mc(q_star), 2))
# 46.67 46.67Check 1: the second-order condition
The first-order condition finds a stationary point. It could be a maximum or a minimum. The second derivative of profit decides which:
d²π/dQ² = −4 − 2 = −6
This is negative for every Q, so profit is concave and Q* is a maximum. Equivalently, MR slopes down at −4 while MC slopes up at +2, so MC cuts MR from below.
Check 2: a schedule with whole units
Many courses present this problem as a table of whole units. Compute profit for each quantity and compare marginal revenue with marginal cost over each extra unit.
| Q | Price | TR | TC | Profit | MR of this unit | MC of this unit |
|---|---|---|---|---|---|---|
| 10 | 80 | 800 | 350 | 450 | n/a | n/a |
| 11 | 78 | 858 | 391 | 467 | 58 | 41 |
| 12 | 76 | 912 | 434 | 478 | 54 | 43 |
| 13 | 74 | 962 | 479 | 483 | 50 | 45 |
| 14 | 72 | 1008 | 526 | 482 | 46 | 47 |
| 15 | 70 | 1050 | 575 | 475 | 42 | 49 |
| 16 | 68 | 1088 | 626 | 462 | 38 | 51 |
Up to the 13th unit, each extra unit adds more to revenue than to cost, so profit rises. The 14th unit adds 46 to revenue and 47 to cost, so profit falls by 1. Profit peaks at 13 units, which is the whole-unit neighbour of 13.33.
The "MR of this unit" column is a discrete difference: TR(Q) − TR(Q−1). It differs slightly from the derivative 100 − 4Q evaluated at Q. At Q = 13 the derivative gives 48, while the one-unit difference gives 50. The derivative is the rate at a point, and the difference is the average change over a whole unit. The two agree better as the unit gets smaller.
Check 3: brute force
A search over many quantities needs no calculus, so it tests the algebra independently:
a, b = 100, 2
f, c, d = 50, 20, 1
def profit(q):
return (a - b * q) * q - (f + c * q + d * q**2)
# Search quantities 0.00, 0.01, ..., 30.00 for the highest profit
best = max((q / 100 for q in range(0, 3001)), key=profit)
print(round(best, 2))
# 13.33The search lands on the same quantity as the formula. If the two disagreed, the likely cause would be a mistake in a derivative or in the algebra.
The same firm as a price taker
Now suppose the firm cannot influence price and faces a market price of 40. Revenue is 40Q, so MR is simply 40. The rule becomes P = MC:
40 = 20 + 2Q, so Q* = 10
TR is 400 and TC is 50 + 200 + 100 = 350, so profit is 50. Before accepting this, apply the shutdown check. Average variable cost at Q* is 20 + Q = 30. Price (40) exceeds AVC (30), so the firm should produce.
# Price-taking firm: P is fixed, so MR = P. Cost: C = f + c*Q + d*Q**2
p = 40
f, c, d = 50, 20, 1
q_star = (p - c) / (2 * d) # solves P = MC = c + 2dQ
total_cost = f + c * q_star + d * q_star**2
profit = p * q_star - total_cost
avc = c + d * q_star # average variable cost at q_star
print(q_star, profit, avc)
# 10.0 50.0 30.0
print('produce' if p >= avc else 'shut down')
# produceTry a lower price, P = 25. Then Q* = 2.5 and AVC = 22.5. The price still exceeds AVC. Revenue is 62.5 and cost is 50 + 50 + 6.25 = 106.25, so the firm loses 43.75. Shutting down would lose the full fixed cost of 50. Producing covers all variable cost and 40 of the 50 fixed cost, so the firm should keep producing at a loss. Below P = 20, MC at zero output already exceeds the price, so the firm should produce nothing.
What happens when the inputs change
Wrap the solution in a function and change one parameter at a time:
def solve(a, b, f, c, d):
q = (a - c) / (2 * b + 2 * d)
p = a - b * q
pi = (a - b * q) * q - (f + c * q + d * q**2)
return q, p, pi
cases = {
"base": (100, 2, 50, 20, 1),
"higher MC (c=26)": (100, 2, 50, 26, 1),
"higher fixed cost": (100, 2, 100, 20, 1),
"higher demand (a=110)": (110, 2, 50, 20, 1),
}
for name, args in cases.items():
q, p, pi = solve(*args)
print(f"{name}: Q={q:.2f} P={p:.2f} profit={pi:.2f}")
# base: Q=13.33 P=73.33 profit=483.33
# higher MC (c=26): Q=12.33 P=75.33 profit=406.33
# higher fixed cost: Q=13.33 P=73.33 profit=433.33
# higher demand (a=110): Q=15.00 P=80.00 profit=625.00| Change | Effect on Q* | Effect on P* | Effect on profit |
|---|---|---|---|
| Marginal cost rises (c from 20 to 26) | Falls to 12.33 | Rises to 75.33 | Falls to 406.33 |
| Fixed cost rises (f from 50 to 100) | Unchanged | Unchanged | Falls by exactly 50 |
| Demand rises (a from 100 to 110) | Rises to 15 | Rises to 80 | Rises to 625 |
Fixed cost does not appear in MR or MC, so changing it cannot move the optimum in the short run. It shifts profit by the same amount at every output level. It can still affect the decision to stay in business if profit turns negative enough.
Exercises
Exercise
A firm faces inverse demand P = 120 − 3Q and has total cost C = 100 + 30Q + Q². Find the profit-maximising quantity, the price and the profit.
Show answer
TR = 120Q − 3Q², so MR = 120 − 6Q. MC = 30 + 2Q. Setting MR = MC gives 90 = 8Q, so Q* = 11.25. The price is P = 120 − 3(11.25) = 86.25. TR = 86.25 × 11.25 = 970.31. TC = 100 + 337.5 + 126.56 = 564.06. Profit = 970.31 − 564.06 = 406.25. The second derivative of profit is −6 − 2 = −8, which is negative, so this is a maximum.
Exercise
A price-taking firm has C = 80 + 10Q + Q² and faces P = 18. What does it produce, what is its profit, and should it shut down? Then repeat for P = 12.
Show answer
At P = 18, MC = 10 + 2Q = 18, so Q = 4. TR = 72 and TC = 80 + 40 + 16 = 136, so profit is −64. AVC = 10 + Q = 14, which is below the price of 18, so the firm produces. Producing loses 64, while shutting down loses the fixed cost of 80. At P = 12, MC = 12 gives Q = 1 and AVC = 11. Since 12 > 11, the firm still produces. TR = 12 and TC = 80 + 10 + 1 = 91, so the loss is 79, which is just under the fixed cost of 80.