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
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: four 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 |
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².
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
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 minIs your child on track?
Take the free placement test