Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics guide, Unit 5, step 19 of 33Previous stepNext step

Step 19: Optimisation

SyllabusAP 5.10–5.11 · 9709 P1 1.7 · IB SL 5.8
In 30 seconds
  • Optimisation means finding the largest or smallest value of a quantity: the biggest area, the least material, the most profit. Write the quantity as a function of one variable using the constraint, state its domain, differentiate and set the derivative to zero.
  • Always justify that you have a maximum or minimum (second derivative, sign change of the first derivative, or the candidates test on a closed interval), then answer the question that was asked, with units.
  • For a firm, profit \( \pi = R-C \) is greatest where \( MR = MC \) (the first-order condition) and \( \pi” < 0 \) (the second-order condition: MC cuts MR from below). Average cost is least where \( MC = AC \).
  • Exam point: revenue is greatest where \( MR = 0 \), which is where the price elasticity of demand is exactly \( -1 \). A profit-maximising firm with positive marginal cost always produces on the elastic part of demand.
Video lesson coming soonA short animated lesson for this step will appear here.

A method for every optimisation problem

The calculus in an optimisation problem is usually two lines long: differentiate, set equal to zero. The skill is everything around it, turning a paragraph of words into a function of one variable and then checking that the answer makes sense. The same five steps work every time.

StepWhat you do
1Draw a diagram, label the variables, and name the quantity to be maximised or minimised.
2Use the constraint to write that quantity as a function of one variable. State the domain (lengths positive, outputs within capacity).
3Differentiate and solve derivative \( = 0 \). Reject solutions outside the domain.
4Justify the maximum or minimum: second derivative test, sign change of the first derivative, or the candidates test if the domain is closed.
5Answer the question asked, in context and with units.
Worked example

A farmer has 60 m of fencing to make a rectangular pen against a long straight wall, so only three sides need fencing. Find the largest possible area.

Step 1Let each side at right angles to the wall be \( x \) m. The side parallel to the wall is then \( 60-2x \) m.
Step 2Area \( A = x(60-2x) = 60x-2x^2 \), with \( 0 < x < 30 \).
Step 3\( \dfrac{dA}{dx} = 60-4x = 0 \) gives \( x = 15 \), which is inside the domain.
Step 4\( \dfrac{d^2A}{dx^2} = -4 < 0 \), so this is a maximum.
Step 5\( A = 15 \times 30 = 450 \).

The greatest area is 450 m², with the pen 15 m deep and 30 m along the wall. Notice the answer is not a square: the free wall changes the shape.

Area of the pen, A = x(60 − 2x) m²
A = 60x − 2x²
510152025301002003004005000x (m)Amaximum (15, 450)
Figure 1. The area is zero at both ends of the domain (x = 0 and x = 30) and greatest in between, where dA/dx = 0 at x = 15.

A minimum problem follows the same steps. The classic one asks for the cheapest shape of a container, where “cheapest” means least surface area for a fixed volume.

Worked example

A closed cylindrical can must hold 500 cm³. Find the radius that minimises the total surface area, and show that the height is then equal to the diameter.

Step 1Radius \( r \), height \( h \). Constraint: \( \pi r^2 h = 500 \), so \( h = \dfrac{500}{\pi r^2} \).
Step 2Surface area \( S = 2\pi r^2 + 2\pi r h = 2\pi r^2 + \dfrac{1000}{r} \), with \( r > 0 \).
Step 3\( \dfrac{dS}{dr} = 4\pi r-\dfrac{1000}{r^2} = 0 \) gives \( r^3 = \dfrac{250}{\pi} \), so \( r = \sqrt[3]{250/\pi} \approx 4.30 \) cm.
Step 4\( \dfrac{d^2S}{dr^2} = 4\pi + \dfrac{2000}{r^3} > 0 \) for every \( r > 0 \): a minimum.
Step 5\( h = \dfrac{500}{\pi r^2} = \dfrac{500}{\pi r^3} \cdot r = \dfrac{500}{250} r = 2r \).

The least surface area is about 349 cm², when \( r \approx 4.30 \) cm and the height equals the diameter, about 8.60 cm.

Distance problems have a useful shortcut. A distance is never negative, so it is smallest exactly where its square is smallest, and the square has no awkward square root to differentiate.

Worked example

Find the point on the curve \( y = \sqrt{x} \) that is closest to the point \( (3, 0) \), and the least distance.

Step 1A point on the curve is \( (x, \sqrt{x}) \), with \( x \ge 0 \). Its squared distance from \( (3, 0) \) is \( D^2 = (x-3)^2 + x = x^2-5x + 9 \).
Step 2\( \dfrac{d(D^2)}{dx} = 2x-5 = 0 \) gives \( x = 2.5 \). The second derivative is \( 2 > 0 \): a minimum.
Step 3At \( x = 2.5 \), \( D^2 = 6.25-12.5 + 9 = 2.75 \), so \( D = \sqrt{2.75} = \tfrac{\sqrt{11}}{2} \approx 1.66 \). (The end point \( x = 0 \) gives \( D = 3 \), which is larger.)

The closest point is \( \left(2.5, \sqrt{2.5}\right) \approx (2.5, 1.58) \), at a distance of about 1.66 units.

Common mistakeStopping at \( x = 15 \) or \( r \approx 4.30 \). The question asked for the largest area or the radius and height; read the last line again and give exactly that, with units. The second most common slip is keeping two variables: if your function still contains both \( r \) and \( h \), you have not used the constraint yet.
Exam tipOn an open domain, such as \( r > 0 \), AP accepts this argument for an absolute extremum: “\( r = 4.30 \) is the only critical point on \( r > 0 \), and \( S’ \) changes from negative to positive there, so it gives the absolute minimum.” On a closed interval, use the candidates test from Step 17 instead. Cambridge 9709 (P1 1.7) asks for these practical problems as “show that” plus “find the stationary value and determine its nature”; IB AA SL 5.8 sets them too, often with a GDC allowed for the final solving.

Profit maximisation: MR = MC

Economics is full of optimisation, and the first-year results all come from setting a derivative to zero. Start with the most important one. Profit is revenue minus cost, \( \pi(Q) = R(Q)-C(Q) \). At a maximum the derivative is zero:

\[ \pi'(Q) = R'(Q)-C'(Q) = 0 \quad\Longleftrightarrow\quad MR = MC. \]

This is the first-order condition (FOC). It is necessary but not sufficient: \( MR = MC \) also holds at a profit minimum. The second-order condition (SOC) \( \pi”(Q) < 0 \) means \( R”(Q) < C”(Q) \): marginal cost must be rising faster than marginal revenue, so the MC curve cuts the MR curve from below.

Worked example

A firm sells in a competitive market at a price of $39, so \( R = 39Q \). Its total cost is \( C = Q^3-12Q^2 + 60Q + 40 \) dollars. Find the output that maximises profit, and the maximum profit.

Step 1\( MR = 39 \) and \( MC = 3Q^2-24Q + 60 \).
Step 2FOC: \( 3Q^2-24Q + 60 = 39 \), so \( 3Q^2-24Q + 21 = 0 \), \( Q^2-8Q + 7 = 0 \), giving \( Q = 1 \) or \( Q = 7 \).
Step 3\( \pi(Q) = -Q^3 + 12Q^2-21Q-40 \), so \( \pi”(Q) = -6Q + 24 \).
Step 4\( Q = 1 \): \( \pi” = 18 > 0 \), a profit minimum, \( \pi(1) = -\$50 \). \( Q = 7 \): \( \pi” = -18 < 0 \), a maximum.
Step 5\( \pi(7) = -343 + 588-147-40 = 58 \).

Profit is maximised at 7 units, giving $58. A firm that stopped at the first solution of \( MR = MC \) would have chosen the worst output nearby, a loss of $50.

MR = MC twice: which crossing is the profit maximum? $ per unit
MC = 3Q² − 24Q + 60MR = price = 39
1234567891020304050607080900Q$Q = 1: MC cuts MR from above, profit minimumQ = 7: MC cuts from below, profit maximum
Figure 2. At Q = 1 marginal cost is falling as it crosses MR, so producing a little more adds profit: a minimum. At Q = 7 it is rising, so π″ < 0 and profit is at its maximum, $58.

Minimum average cost: MC = AC

Average cost is \( AC(Q) = \dfrac{C(Q)}{Q} \). Differentiate with the quotient rule:

\[ \frac{d(AC)}{dQ} = \frac{Q\,C'(Q)-C(Q)}{Q^2} = \frac{1}{Q}\left(MC-AC\right). \]

For \( Q > 0 \), the sign of the slope of AC is the sign of \( MC-AC \). This is the rule you know from test marks: if your next mark is below your average, the average falls; if it is above, the average rises. So AC falls while \( MC < AC \), rises once \( MC > AC \), and at its lowest point \( MC = AC \). The MC curve passes through the bottom of the AC curve.

Worked example

A firm’s cost is \( C = 0.5Q^2 + 10Q + 200 \) dollars. Find the output that minimises average cost, and check that \( MC = AC \) there.

Step 1\( AC = 0.5Q + 10 + \dfrac{200}{Q} \).
Step 2\( \dfrac{d(AC)}{dQ} = 0.5-\dfrac{200}{Q^2} = 0 \) gives \( Q^2 = 400 \), so \( Q = 20 \).
Step 3\( \dfrac{d^2(AC)}{dQ^2} = \dfrac{400}{Q^3} > 0 \): a minimum. \( AC(20) = 10 + 10 + 10 = 30 \).
Step 4Check: \( MC = Q + 10 = 30 \) at \( Q = 20 \). Equal, as the theory says.

Average cost is lowest, at $30 per unit, when the firm makes 20 units.

Average cost and marginal cost $ per unit
AC = 0.5Q + 10 + 200/QMC = Q + 10
510152025303540455010203040506070800Q$minimum AC: (20, 30)MC < AC: AC fallingMC > AC: AC rising
Figure 3. MC passes through the lowest point of AC. To the left, each extra unit costs less than the average and pulls it down; to the right, it costs more and pulls it up.

Revenue maximisation and elasticity

When a firm sets its own price, demand slopes down and price depends on output: \( P = P(Q) \). Revenue is \( R = PQ \), and the product rule gives

\[ MR = P + Q\frac{dP}{dQ} = P\left(1 + \frac{1}{\varepsilon}\right), \qquad \varepsilon = \frac{dQ}{dP}\cdot\frac{P}{Q}, \]

where \( \varepsilon \) is the price elasticity of demand (negative for a normal demand curve). Revenue is greatest where \( MR = 0 \), that is where \( \varepsilon = -1 \): unit elasticity. Where demand is elastic (\( \varepsilon < -1 \)), \( MR > 0 \), so selling more by cutting the price raises revenue; where it is inelastic, \( MR < 0 \) and a price cut loses revenue.

Worked example

A monopolist faces demand \( Q = 120-4P \) and has cost \( C = 6Q + 100 \). Find (a) the revenue-maximising output, with the elasticity there, and (b) the profit-maximising output, price and profit.

Step 1Inverse demand: \( P = 30-\tfrac{Q}{4} \), so \( R = 30Q-\tfrac{Q^2}{4} \) and \( MR = 30-\tfrac{Q}{2} \).
Step 2(a) \( MR = 0 \) at \( Q = 60 \), \( P = 15 \); \( R” = -\tfrac{1}{2} < 0 \), a maximum. \( \dfrac{dQ}{dP} = -4 \), so \( \varepsilon = -4 \times \tfrac{15}{60} = -1 \).
Step 3(b) \( MC = 6 \). \( MR = MC \): \( 30-\tfrac{Q}{2} = 6 \), so \( Q = 48 \) and \( P = 30-12 = 18 \). \( \pi” = -\tfrac{1}{2} < 0 \), a maximum.
Step 4Profit \( = 18 \times 48-(6 \times 48 + 100) = 864-388 = 476 \).

The firm sells 48 units at $18 for a profit of $476, fewer units at a higher price than the revenue maximum. At \( Q = 48 \), \( \varepsilon = -4 \times \tfrac{18}{48} = -1.5 \), elastic, and indeed \( MR = 18\left(1-\tfrac{2}{3}\right) = 6 = MC \).

Exam tipIn economics papers, always state both conditions: “FOC: \( MR = MC \) at \( Q = 7 \); SOC: \( \pi”(7) = -18 < 0 \), so profit is a maximum.” Examiners give the SOC mark separately, and with a cubic cost function it is the mark that tells the two solutions apart.

Practise: 6 questions

Try each one on paper first, then check the worked answer.

EasyQ1. Two positive numbers add up to 20. Find the largest possible value of their product. Show worked answer
Let the numbers be \( x \) and \( 20-x \), with \( 0 < x < 20 \).
\( P = x(20-x) = 20x-x^2 \), so \( P’ = 20-2x = 0 \) at \( x = 10 \).
\( P” = -2 < 0 \): a maximum.
Both numbers are 10, and the largest product is 100.
EasyQ2. A firm’s profit is \( \pi(Q) = -2Q^2 + 80Q-300 \) dollars. Find the profit-maximising output and the maximum profit. Show worked answer
\( \pi'(Q) = -4Q + 80 = 0 \) at \( Q = 20 \).
\( \pi”(Q) = -4 < 0 \): a maximum.
\( \pi(20) = -800 + 1600-300 = 500 \).
Maximum profit $500, at 20 units.
MediumQ3. Squares of side \( x \) cm are cut from the corners of a 30 cm by 16 cm sheet of card, and the sides are folded up to make an open box. Find the value of \( x \) that gives the greatest volume, and that volume. Show worked answer
\( V = x(30-2x)(16-2x) = 4x^3-92x^2 + 480x \), with \( 0 < x < 8 \).
\( V’ = 12x^2-184x + 480 = 4(3x-10)(x-12) \).
\( x = 12 \) is outside the domain, so \( x = \tfrac{10}{3} \).
\( V” = 24x-184 = -104 < 0 \) at \( x = \tfrac{10}{3} \): a maximum.
\( V = \tfrac{10}{3} \times \tfrac{70}{3} \times \tfrac{28}{3} = \tfrac{19600}{27} \approx 726 \) cm³.
MediumQ4. A firm’s total cost is \( C = 2Q^2 + 18Q + 128 \). Find the output that minimises average cost, and verify that \( MC = AC \) there. Show worked answer
\( AC = 2Q + 18 + \dfrac{128}{Q} \).
\( AC’ = 2-\dfrac{128}{Q^2} = 0 \) gives \( Q^2 = 64 \), so \( Q = 8 \).
\( AC” = \dfrac{256}{Q^3} > 0 \): a minimum. \( AC(8) = 16 + 18 + 16 = 50 \).
\( MC = 4Q + 18 = 50 \) at \( Q = 8 \). So \( MC = AC = \$50 \).
MediumQ5. Demand for a product is \( P = 90-3Q \). Find the output and price that maximise revenue, the maximum revenue, and the price elasticity of demand at that point. Show worked answer
\( R = 90Q-3Q^2 \), \( MR = 90-6Q = 0 \) at \( Q = 15 \); \( R” = -6 < 0 \).
\( P = 90-45 = 45 \), and \( R = 45 \times 15 = 675 \).
\( Q = 30-\tfrac{P}{3} \), so \( \dfrac{dQ}{dP} = -\tfrac{1}{3} \).
\( \varepsilon = -\tfrac{1}{3} \times \tfrac{45}{15} = -1 \): unit elastic, as expected at a revenue maximum.
ExamQ6. An open box (no lid) has a square base of side \( x \) cm and a volume of 500 cm³. (a) Show that the external surface area is \( A = x^2 + \dfrac{2000}{x} \). [2] (b) Find the value of \( x \) for which \( A \) is stationary, and the corresponding value of \( A \). [3] (c) Determine the nature of this stationary value, and state the height of the box. [2] Show worked answer
(a) Height \( h \): \( x^2 h = 500 \), so \( h = \dfrac{500}{x^2} \). [M1]
\( A = x^2 + 4xh = x^2 + 4x \cdot \dfrac{500}{x^2} = x^2 + \dfrac{2000}{x} \). [A1]
(b) \( \dfrac{dA}{dx} = 2x-\dfrac{2000}{x^2} \). [M1]
\( = 0 \) gives \( x^3 = 1000 \), \( x = 10 \). [A1]
\( A = 100 + 200 = 300 \) cm². [A1]
(c) \( \dfrac{d^2A}{dx^2} = 2 + \dfrac{4000}{x^3} = 6 > 0 \), so a minimum. [M1]
Height \( h = \dfrac{500}{100} = 5 \) cm. [A1]
Total: 7 marks.

Check yourself

1. What is the first-order condition for profit maximisation?

\( \pi'(Q) = R'(Q)-C'(Q) = 0 \) means \( MR = MC \). \( MR = 0 \) maximises revenue, and \( MC = AC \) minimises average cost.

2. At the output that maximises revenue, the price elasticity of demand is

\( MR = P\left(1 + \tfrac{1}{\varepsilon}\right) \), which is zero exactly when \( \varepsilon = -1 \).

3. At the current output, marginal cost is below average cost. What is happening to average cost as output rises?

\( \dfrac{d(AC)}{dQ} = \dfrac{MC-AC}{Q} < 0 \) when \( MC < AC \): a cheaper extra unit pulls the average down.

Your score: 0 out of 3

The short version

  • Method: diagram, one-variable function with its domain, derivative \( = 0 \), justify max or min, answer the question with units.
  • Justify with the second derivative, a sign change of the first derivative, or the candidates test on a closed interval. On an open domain, a single critical point that is a local extremum is the absolute one.
  • Profit: FOC \( MR = MC \), SOC \( \pi” < 0 \) (MC cuts MR from below). With a cubic cost, one solution of \( MR = MC \) is a profit minimum.
  • \( \dfrac{d(AC)}{dQ} = \dfrac{MC-AC}{Q} \), so average cost is least where \( MC = AC \).
  • \( MR = P\left(1 + \tfrac{1}{\varepsilon}\right) \): revenue is greatest where \( \varepsilon = -1 \), and a profit-maximising firm with \( MC > 0 \) prices on the elastic part of demand.
  • The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Want more questions like these, with worked answers?
The practice book has hundreds more, graded from easy to exam level.
Next: step 20 of 33Riemann Sums and the Definite Integral