Optimisation: building the model and finding the max or min
What this lesson covers
- Optimising means writing the quantity as a function of one variable, then finding its stationary point.
- At Achieved and Merit the question tells you whether it is a maximum or minimum.
Optimising: the greatest or least value
- Differentiate, set to zero, solve.
- The hard part comes first.
- Write it as a function of one variable.
Four steps
- Name the variables, and sketch.
- Write the quantity to optimise.
- Use the constraint to remove one.
- Differentiate and set it to zero.
40 m of fence, three sides
- The wall is the fourth side.
- One variable: the width x.
- width = x
- length = 40 − 2x2x + length = 40
- A = x(40 − 2x)width × length
- = 40x − 2x²expand
Differentiate and solve
- Set the derivative to zero.
- Check: a maximum.
- dA/dx = 40 − 4xdifferentiate
- 40 − 4x = 0stationary
- 4x = 40, so x = 10
- d²A/dx² = −4 < 0a maximum
- length = 40 − 20 = 20
- A = 10 × 20 = 200 m²
The graph of the area
- A parabola, opening down.
- Zero gradient at x = 10.
- The top: A = 200.

Try it: three sides of fence
The 2025 weakness: the model
- A = xy has two variables.
- The constraint gives y = 40 − 2x.
- Substitute: A in terms of x alone.
| A = xy | two variables | stuck |
| 2x + y = 40 | y = 40 − 2x | constraint |
| A = x(40 − 2x) | one variable | ready |
An open box from 12 cm card
- Cut x from each corner.
- Expand, then differentiate.
- height x, base 12 − 2xx off each end
- V = x(12 − 2x)²height × base²
- = x(144 − 48x + 4x²)expand
- = 4x³ − 48x² + 144x
- dV/dx = 12x² − 96x + 144differentiate
- = 12(x² − 8x + 12)
- = 12(x − 2)(x − 6)factorise
Try it: the open box
Solve, reject, check
- x = 6 makes no box.
- Second derivative: a max.
- dV/dx = 12(x − 2)(x − 6)
- 12(x − 2)(x − 6) = 0stationary
- x = 2 or x = 6
- x = 6: base 12 − 12 = 0no box
- d²V/dx² = 24x − 96
- x = 2: 48 − 96 = −48 < 0a maximum
- V = 2(12 − 4)²
- = 2 × 64 = 128 cm³
A minimum: an open tank
- Open top: base, four sides.
- The volume gives h.
- x²h = 32 000volume
- h = 32 000/x²
- S = x² + 4xhbase + four sides
- = x² + 4x(32 000/x²)substitute h
- = x² + 128 000/x
- = x² + 128 000x⁻¹power form
- dS/dx = 2x − 128 000x⁻²differentiate
- = 2x − 128 000/x²
Solve, check, answer
- Clear the fraction first.
- Positive: a minimum.
- dS/dx = 2x − 128 000/x²
- 2x − 128 000/x² = 0stationary
- 2x³ = 128 000multiply by x²
- x³ = 64 000, so x = 40
- h = 32 000/1600 = 20
- d²S/dx² = 2 + 256 000/x³
- x = 40: 2 + 4 = 6 > 0a minimum
- S = 1600 + 128 000/40
- = 1600 + 3200 = 4800 cm²
Maximum or minimum?
- Achieved, Merit: you may assume it.
- Excellence: be ready to show it.
- S'' = 6 > 0 at x = 40: a minimum.
A rectangle under y = 12 − x²
- Corners at ±x on the axis.
- Width 2x, height y.
- width 2x, height 12 − x²
- A = 2x(12 − x²)
- = 24x − 2x³expand
- dA/dx = 24 − 6x²
- 24 − 6x² = 0stationary
- 6x² = 24, so x² = 4
- x = 2x > 0, a length
- d²A/dx² = −12x = −24 < 0a maximum
- A = 4 × 8 = 32width 4, height 8
Try it: maximum or minimum?
Answer the question asked
- Greatest area? Give the area, not x.
- Dimensions? Give both.
- Say why you rejected a value.
Show the model and the derivative
- No credit for a calculator answer alone.
- Unknown constants stop the calculator.
- Use it to check, not to replace.
Where the marks are
- Achieved: differentiate a given model.
- Merit: build the one-variable model.
- Excellence: your own model, justified.
What to take away
- Build a function of one variable first. The calculus is the short part.
| Name | the variables |
| Write | the quantity |
| Constraint | down to one variable |
| Differentiate | set it equal to 0 |
| Check | reject impossible x |
| Answer | what was asked, units |
Common mistakes
- A = xy, so dA/dx = y.A has two variables; use the constraint y = 40 − 2x to write A = 40x − 2x² before differentiating.
- x = 2 or x = 6, so the biggest box has x = 6.x = 6 leaves a base of 12 − 12 = 0, so there is no box; reject it with that reason and use x = 2, V = 128 cm³.
- Greatest area: x = 10.The question asks for the area, so finish with A = 10 × 20 = 200 m², with units.
- d²S/dx² = 6 > 0, so the surface area is a maximum.A positive second derivative means concave up, so it is a minimum; negative means a maximum.
Your turn: eight questions
- You may assume each is a max or min.
- Write the model and the derivative.
| Given | Find | |
|---|---|---|
| 1 | rectangle, perimeter 60 | maximum area |
| 2 | P = −2x² + 48x − 100 | maximum profit |
| 3 | 18 cm square card | maximum box volume |
| 4 | square base, 4000 cm³ | min surface, open top |
| 5 | rectangle, area 100 m², width x m | perimeter in terms of x |
| 6 | box, V = x(24 − 2x)², V′ = 0 at x = 4, 12 | x for maximum V, and why |
| 7 | C = 3x + 75/x, x > 0 | C″(5), nature at x = 5 |
| 8 | open cylinder, volume 1000π cm³ | r and h, least material |
Show answer
1. A = x(30 − x), dA/dx = 30 − 2x, x = 15: 225 m², a square. 2. dP/dx = −4x + 48, x = 12: P = 188. 3. V = x(18 − 2x)², dV/dx = 12(x − 3)(x − 9), x = 3 (x = 9 gives no box): 432 cm³. 4. S = x² + 16 000/x, dS/dx = 2x − 16 000/x², x = 20, h = 10: 1200 cm². 5. P = 2x + 200/x. The length is 100/x, so P = 2x + 2(100/x). 6. x = 4, as x = 12 gives no box. At x = 12 the base side 24 − 2x is 0, and V″(4) = −96 < 0 confirms a maximum. 7. C″(5) = 1.2 > 0, a minimum. C′ = 3 − 75/x², so C″ = 150/x³ = 150/125 = 1.2, which is positive. 8. r = 10 cm, h = 10 cm. h = 1000/r², so S = πr² + 2000π/r and S′ = 2πr − 2000π/r² = 0 gives r³ = 1000.
The answers: questions 1 and 2
- 1. 2x + 2y = 60, y = 30 − xperimeter
- A = x(30 − x) = 30x − x²
- dA/dx = 30 − 2x = 0, x = 15
- y = 15: A = 15 × 15 = 225 m²a square
- 2. dP/dx = −4x + 48differentiate
- −4x + 48 = 0, x = 12
- d²P/dx² = −4 < 0a maximum
- P = −288 + 576 − 100 = 188
The answers: question 3
- 3. V = x(18 − 2x)²base 18 − 2x
- = 4x³ − 72x² + 324xexpand
- dV/dx = 12x² − 144x + 324differentiate
- = 12(x − 3)(x − 9) = 0factorise
- x = 9: base 18 − 18 = 0no box
- x = 3: V = 3(18 − 6)²
- = 3 × 144 = 432 cm³
The answers: question 4
- 4. x²h = 4000, h = 4000/x²volume
- S = x² + 4xh = x² + 16 000/xsubstitute h
- dS/dx = 2x − 16 000/x² = 0
- 2x³ = 16 000, x³ = 8000multiply by x²
- x = 20, h = 4000/400 = 10
- S = 400 + 16 000/20
- = 400 + 800 = 1200 cm²
Sample question: Achieved
A farmer uses 300 m of fencing to make a rectangular paddock, split into two equal pens by one extra fence parallel to one side. Let x be the length of each of the three parallel fences. Find the maximum total area.
Hint
There are three fences of length x and two of length y, so 3x + 2y = 300. Write the area in terms of x only, then differentiate.
Answer
The maximum area is 3750 m², when x = 50 m and the other side is 75 m.
Step by step
- Draw it: three fences of length x (two ends and the divider) and two long sides of length y.
- Total fence: 3x + 2y = 300, so y = 150 − 3x2.
- Area: A = xy = x(150 − 3x2) = 150x − 3x²2. Now A is a function of x only.
- Differentiate: dAdx = 150 − 3x. At a maximum the gradient is zero: 150 − 3x = 0, so x = 50.
- Then y = 150 − 75 = 75.
- A = 50 × 75 = 3750 m². The second derivative is −3, which is negative, so this is the maximum.
- Check the fence: 3(50) + 2(75) = 150 + 150 = 300 m. Correct.
Full working
- 3x + 2y = 300, so y = 150 − 3x2
- A = 150x − 3x²2
- dAdx = 150 − 3x = 0, x = 50
- y = 75, A = 50 × 75d²Adx² = −3 < 0
- 3750 m²
Sample questions: Merit
A closed box has a rectangular base x cm by 2x cm and a volume of 72 cm³. Find the dimensions that make its surface area as small as possible, and the minimum surface area.
Hint
Use the volume to write the height h in terms of x. Then write the total area of all six faces in terms of x and differentiate.
Answer
Base 3 cm by 6 cm, height 4 cm; minimum surface area 108 cm²
Step by step
- There are two unknowns, x and the height h. The volume links them: 2x²h = 72, so h = 36x².
- A closed box has six faces. Top and bottom: 2 × 2x² = 4x². Two sides x by h: 2xh. Two sides 2x by h: 4xh.
- So S = 4x² + 6xh. Substitute h: S = 4x² + 6x(36x²) = 4x² + 216x.
- Write 216x as 216x⁻¹ to differentiate: dSdx = 8x − 216x⁻² = 8x − 216x².
- Set dSdx = 0: 8x = 216x², so 8x³ = 216 and x³ = 27. So x = 3.
- Then h = 369 = 4. The base is 3 cm by 6 cm.
- Show it is a minimum: d²Sdx² = 8 + 432x³, which is 8 + 16 = 24 at x = 3. Positive, so it is a minimum.
- S = 4(9) + 2163 = 36 + 72 = 108 cm².
- Check the volume: 3 × 6 × 4 = 72 cm³. Correct.
Full working
- 2x²h = 72, so h = 36x²volume constraint
- S = 4x² + 6xh = 4x² + 216x
- dSdx = 8x − 216x² = 0, x³ = 27, x = 3
- h = 369 = 4
- d²Sdx² = 8 + 432x³ = 24 > 0a minimum
- S = 36 + 72 = 108
- 3 cm by 6 cm by 4 cm high, S = 108 cm²
Find the point on the curve y = √x that is closest to the point (3, 0), and the shortest distance. Give exact values.
Hint
Write the square of the distance in terms of x. The distance is smallest where its square is smallest, and the square has no root sign to differentiate.
Answer
The point (52, √102); the shortest distance is √112.
Step by step
- A point on the curve is (x, √x). Its distance from (3, 0) is D = √((x − 3)² + (√x)²).
- D is smallest exactly where D² is smallest, because D is never negative. D² is easier to work with.
- D² = (x − 3)² + x = x² − 6x + 9 + x = x² − 5x + 9.
- Differentiate: d(D²)dx = 2x − 5. Set it to zero: x = 52.
- The second derivative is 2, which is positive, so this is a minimum.
- The point is (52, √(52)). Tidy the root: √(52) = √102.
- D² = (52)² − 5(52) + 9 = 254 − 504 + 364 = 114, so D = √112.
- Check: from (3, 0) to (2.5, 1.581) the distance is √(0.25 + 2.5) = √2.75 ≈ 1.658, and √112 ≈ 1.658. Correct.
Full working
- D² = (x − 3)² + x = x² − 5x + 9point (x, √x)
- d(D²)dx = 2x − 5 = 0, x = 52
- second derivative 2 > 0a minimum
- y = √(52) = √102
- D² = 254 − 504 + 364 = 114
- (52, √102), shortest distance √112
Sample questions: Excellence
A cone has a slant height of 12 cm. Find the exact height that gives the greatest volume, and the greatest volume. Justify that it is a maximum.
Hint
The radius r, the height h and the slant height form a right triangle, so r² + h² = 144. Use this to write V = (13)πr²h in terms of h only.
Answer
h = 4√3 cm, and the greatest volume is 128√3π cm³ (about 696.5 cm³).
Step by step
- The volume of a cone is V = (13)πr²h. It has two variables, so we need a link between r and h.
- Cut the cone down the middle: r, h and the slant height 12 make a right triangle. So r² + h² = 144 and r² = 144 − h².
- Substitute: V = (13)π(144 − h²)h = (π3)(144h − h³). Using r² directly saves taking a square root.
- Differentiate: dVdh = (π3)(144 − 3h²).
- Set it to zero: 3h² = 144, so h² = 48 and h = √48 = 4√3. The height is positive, so ignore −4√3.
- Justify the maximum: d²Vdh² = (π3)(−6h) = −2πh. At h = 4√3 this is negative, so it is a maximum.
- Then r² = 144 − 48 = 96.
- V = (13)π(96)(4√3) = 128√3π cm³.
- Sense check: h must be between 0 and 12, and 4√3 ≈ 6.93 is. At both ends the volume is 0, so a maximum in between makes sense.
Full working
- r² + h² = 144, r² = 144 − h²right triangle
- V = (π3)(144h − h³)
- dVdh = (π3)(144 − 3h²) = 0, h² = 48
- h = 4√3h > 0
- d²Vdh² = −2πh < 0a maximum
- V = (13)π(96)(4√3) = 128√3π
- h = 4√3 cm, V = 128√3π cm³ ≈ 696.5 cm³
A ferry makes a 40 km crossing from Auckland to Waiheke Island at a steady speed of v km per hour. Its fuel costs $0.5v² per hour and the crew cost $800 per hour. Find the speed that makes the total cost of one crossing as small as possible, show that it is a minimum, and give the minimum cost. State one limitation of the model.
Hint
The crossing takes 40v hours. Multiply the cost per hour by the time to get the cost of the trip as a function of v.
Answer
40 km per hour, with a minimum cost of $1600 per crossing. A limitation: the ferry may not be able to travel at exactly 40 km per hour, and real fuel use depends on weather, tide and load.
Step by step
- Build the model first. Time for the trip = distance ÷ speed = 40v hours.
- The cost per hour, in dollars, is 0.5v² + 800. So the cost of the trip is C = (0.5v² + 800) × 40v.
- Simplify: C = 20v + 32000v. Write it as C = 20v + 32000v⁻¹ to differentiate.
- dCdv = 20 − 32000v².
- Set it to zero: 20v² = 32000, so v² = 1600 and v = 40. A speed is positive, so ignore −40.
- Show it is a minimum: d²Cdv² = 64000v³, which is positive for v > 0. So v = 40 gives a minimum.
- C = 20(40) + 3200040 = 800 + 800 = $1600.
- Why it makes sense: going faster burns more fuel per hour, but going slower pays the crew for longer. The best speed balances the two, and here the fuel and crew costs are equal.
- Limitations: the ferry might have a top speed or a timetable that rules out 40 km per hour, and the fuel formula is only a model. Wind, tide and the number of passengers all change fuel use.
Full working
- time = 40v hours
- C = (0.5v² + 800) × 40v = 20v + 32000v
- dCdv = 20 − 32000v² = 0
- v² = 1600, v = 40v > 0
- d²Cdv² = 64000v³ > 0a minimum
- C = 800 + 800 = $1600
- 40 km per hour, $1600 per crossing
Challenge
A closed cylindrical tin must hold 256π cm³. The metal for the top and bottom costs twice as much per cm² as the metal for the curved side. Find the radius and height that make the tin cheapest, and show that it is a minimum. Then show that for any volume, the cheapest tin of this kind always has height = 4 × radius.
Hint
Let the side cost k per cm², so the ends cost 2k per cm². Write the cost in terms of r alone using the volume, then differentiate. For the general result, keep the volume as V instead of 256π.
Answer
r = 4 cm, h = 16 cm (minimum cost 192πk); in general r³ = V4π, which gives h = Vπr² = 4r
Step by step
- Cost = 2k × (two ends, 2πr²) + k × (side, 2πrh) = k(4πr² + 2πrh).
- The volume gives πr²h = 256π, so h = 256r², and the cost becomes k(4πr² + 512πr).
- Set the derivative to zero: 8πr = 512πr², so r³ = 64 and r = 4, h = 16.
- The second derivative is positive, so this is a minimum.
- With volume V the same steps give r³ = V4π, so h = Vπr² = Vπr³ × r = 4r.
Full working
- C = 2k(2πr²) + k(2πrh) = k(4πr² + 2πrh)ends cost double
- πr²h = 256π, so h = 256r²the volume constraint
- C = k(4πr² + 512πr⁻¹)one variable
- dCdr = k(8πr − 512πr⁻²)differentiate
- 8πr = 512πr², so r³ = 64, r = 4stationary
- h = 25616 = 16back into the constraint
- d²Cdr² = k(8π + 1024πr³) = 24πk > 0 at r = 4a minimum
- General V: dCdr = k(8πr − 2Vr²) = 0, so r³ = V4πsame method
- h = Vπr² = (Vπr³) × r = 4rVπr³ = 4
- r = 4 cm, h = 16 cm; and always h = 4r
A sheet of steel 30 cm wide is made into spouting for a shed in Hawke's Bay. The middle 10 cm strip is the flat base, and the 10 cm strips on each side are bent up, each making the same angle θ with the horizontal (0 < θ < π2), so the cross-section is a trapezium. Find the exact θ that gives the greatest cross-section area, and that area. Then decide whether bending the same 30 cm sheet into a semicircle would carry more water, with a reason.
Hint
Each side rises 10sin θ and reaches out 10cos θ past the base. Use the trapezium area formula, then use sin²θ = 1 − cos²θ to turn dAdθ = 0 into a quadratic in cos θ.
Answer
θ = π3 (60°), greatest area 75√3 ≈ 129.9 cm²; the semicircle carries more: 450π ≈ 143.2 cm²
Step by step
- The height is 10sin θ, the top width is 10 + 20cos θ, and the base is 10.
- Area = half the sum of the parallel sides × height = 100sin θ(1 + cos θ).
- Differentiate with the product rule and replace sin²θ by 1 − cos²θ: a quadratic in cos θ.
- It factorises to (2cos θ − 1)(cos θ + 1) = 0, and only cos θ = 12 fits, so θ = π3.
- A semicircle of arc length 30 has radius 30π, so its area is (12)π(30π)² = 450π, which is bigger.
Full working
- height = 10sin θ, top = 10 + 20cos θeach side reaches out 10cos θ
- A = (12)(10 + 10 + 20cos θ)(10sin θ) = 100sin θ(1 + cos θ)trapezium
- dAdθ = 100(cos θ(1 + cos θ) − sin²θ)product rule
- = 100(2cos²θ + cos θ − 1)sin²θ = 1 − cos²θ
- = 100(2cos θ − 1)(cos θ + 1) = 0factorise
- cos θ = 12, θ = π3cos θ = −1 is outside the range
- d²Adθ² = 100(−sin θ − 4sin θ cos θ) = −150√3 < 0 at π3a maximum
- A = 100(√32)(32) = 75√3 ≈ 129.9 cm²substitute
- semicircle: πR = 30, R = 30π, area = (12)πR² = 450π ≈ 143.2 cm²larger
- θ = π3, area 75√3 ≈ 129.9 cm²; the semicircle (143.2 cm²) carries more
A rectangular beam is cut from a round log of diameter 60 cm, so the corners of its cross-section lie on the circle. The beam's strength is proportional to w d², and its stiffness is proportional to w d³, where w is the width and d the depth, both in cm. Find the exact dimensions of the strongest beam and of the stiffest beam. Show that the ratio d : w is √2 : 1 for the strongest beam and √3 : 1 for the stiffest.
Hint
The diagonal of the rectangle is a diameter, so w² + d² = 3600. For stiffness, write d³ = (3600 − w²)^(32) and use the chain rule; take out a common factor of √(3600 − w²).
Answer
Strongest: w = 20√3 ≈ 34.6 cm, d = 20√6 ≈ 49.0 cm (d : w = √2 : 1). Stiffest: w = 30 cm, d = 30√3 ≈ 52.0 cm (d : w = √3 : 1)
Step by step
- The diagonal is the diameter, so d² = 3600 − w².
- Strength: S = w(3600 − w²), so dSdw = 3600 − 3w² = 0 gives w² = 1200 and d² = 2400.
- d²w² = 24001200 = 2, so d : w = √2 : 1, and d²Sdw² = −6w < 0 confirms a maximum.
- Stiffness: T = w(3600 − w²)^(32); the product and chain rules give dTdw = 4(900 − w²)√(3600 − w²).
- So w = 30 and d² = 2700, d = 30√3, and d : w = √3 : 1. The sign of dTdw goes from + to −, so it is a maximum.
Full working
- w² + d² = 60² = 3600the diagonal is a diameter
- S = w d² = w(3600 − w²) = 3600w − w³strength, one variable
- dSdw = 3600 − 3w² = 0, w² = 1200stationary
- w = 20√3, d² = 2400, d = 20√6d²Sdw² = −6w < 0, a maximum
- dw = √(24001200) = √2strongest ratio
- T = w d³ = w(3600 − w²)^(32)stiffness
- dTdw = (3600 − w²)^(32) + w × (32)(3600 − w²)^(12) × (−2w)product and chain rules
- = √(3600 − w²)(3600 − w² − 3w²) = 4(900 − w²)√(3600 − w²)common factor
- w = 30, d² = 2700, d = 30√3dTdw > 0 for w < 30, < 0 for w > 30
- dw = 30√330 = √3stiffest ratio
- strongest 20√3 by 20√6 (√2 : 1); stiffest 30 by 30√3 (√3 : 1)
Practise this
Report a mistake
More in AS 91578
The derivative toolkit: chain, product and quotient rules11 min
Stationary points, concavity and points of inflection11 min
Tangents and normals: from gradient to finished equation11 min
Parametric differentiation, and the second derivative11 min
Related rates of change: spheres, cones and the chain rule10 min
Optimisation: building the model and finding the max or min11 min
Limits, continuity and differentiability from a graph8 min
Derivative toolkit: 7 exam questions solved step by step11 min
Stationary points: 7 exam questions solved step by step12 min
Tangents and normals: 7 exam questions solved step by step12 min
Parametric curves: 7 exam questions solved step by step11 min
Related rates of change: 7 exam questions solved step by step11 min
Optimisation: 7 exam questions solved step by step11 min
Limits and continuity: 7 exam questions solved step by step11 min