Vertex Learn

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.
Key idea

Optimising: the greatest or least value

  • Differentiate, set to zero, solve.
  • The hard part comes first.
  • Write it as a function of one variable.
Key idea

Four steps

  1. Name the variables, and sketch.
  2. Write the quantity to optimise.
  3. Use the constraint to remove one.
  4. Differentiate and set it to zero.
Worked example

40 m of fence, three sides

  • The wall is the fourth side.
  • One variable: the width x.
  1. width = x
  2. length = 40 − 2x2x + length = 40
  3. A = x(40 − 2x)width × length
  4. = 40x − 2x²expand
Worked example

Differentiate and solve

  • Set the derivative to zero.
  • Check: a maximum.
  1. dA/dx = 40 − 4xdifferentiate
  2. 40 − 4x = 0stationary
  3. 4x = 40, so x = 10
  4. d²A/dx² = −4 < 0a maximum
  5. length = 40 − 20 = 20
  6. A = 10 × 20 = 200 m²
Worked example

The graph of the area

  • A parabola, opening down.
  • Zero gradient at x = 10.
  • The top: A = 200.
The graph of the area
Key idea

Try it: three sides of fence

Worked example

The 2025 weakness: the model

  • A = xy has two variables.
  • The constraint gives y = 40 − 2x.
  • Substitute: A in terms of x alone.
A = xytwo variablesstuck
2x + y = 40y = 40 − 2xconstraint
A = x(40 − 2x)one variableready
Worked example

An open box from 12 cm card

  • Cut x from each corner.
  • Expand, then differentiate.
  1. height x, base 12 − 2xx off each end
  2. V = x(12 − 2x)²height × base²
  3. = x(144 − 48x + 4x²)expand
  4. = 4x³ − 48x² + 144x
  5. dV/dx = 12x² − 96x + 144differentiate
  6. = 12(x² − 8x + 12)
  7. = 12(x − 2)(x − 6)factorise
Key idea

Try it: the open box

Worked example

Solve, reject, check

  • x = 6 makes no box.
  • Second derivative: a max.
  1. dV/dx = 12(x − 2)(x − 6)
  2. 12(x − 2)(x − 6) = 0stationary
  3. x = 2 or x = 6
  4. x = 6: base 12 − 12 = 0no box
  5. d²V/dx² = 24x − 96
  6. x = 2: 48 − 96 = −48 < 0a maximum
  7. V = 2(12 − 4)²
  8. = 2 × 64 = 128 cm³
Worked example

A minimum: an open tank

  • Open top: base, four sides.
  • The volume gives h.
  1. x²h = 32 000volume
  2. h = 32 000/x²
  3. S = x² + 4xhbase + four sides
  4. = x² + 4x(32 000/x²)substitute h
  5. = x² + 128 000/x
  6. = x² + 128 000x⁻¹power form
  7. dS/dx = 2x − 128 000x⁻²differentiate
  8. = 2x − 128 000/x²
Worked example

Solve, check, answer

  • Clear the fraction first.
  • Positive: a minimum.
  1. dS/dx = 2x − 128 000/x²
  2. 2x − 128 000/x² = 0stationary
  3. 2x³ = 128 000multiply by x²
  4. x³ = 64 000, so x = 40
  5. h = 32 000/1600 = 20
  6. d²S/dx² = 2 + 256 000/x³
  7. x = 40: 2 + 4 = 6 > 0a minimum
  8. S = 1600 + 128 000/40
  9. = 1600 + 3200 = 4800 cm²
Key idea

Maximum or minimum?

  • Achieved, Merit: you may assume it.
  • Excellence: be ready to show it.
  • S'' = 6 > 0 at x = 40: a minimum.
Worked example

A rectangle under y = 12 − x²

  • Corners at ±x on the axis.
  • Width 2x, height y.
  1. width 2x, height 12 − x²
  2. A = 2x(12 − x²)
  3. = 24x − 2x³expand
  4. dA/dx = 24 − 6x²
  5. 24 − 6x² = 0stationary
  6. 6x² = 24, so x² = 4
  7. x = 2x > 0, a length
  8. d²A/dx² = −12x = −24 < 0a maximum
  9. A = 4 × 8 = 32width 4, height 8
Key idea

Try it: maximum or minimum?

Key idea

Answer the question asked

  • Greatest area? Give the area, not x.
  • Dimensions? Give both.
  • Say why you rejected a value.
Key idea

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.
Key idea

Where the marks are

  • Achieved: differentiate a given model.
  • Merit: build the one-variable model.
  • Excellence: your own model, justified.
Summary

What to take away

  • Build a function of one variable first. The calculus is the short part.
Namethe variables
Writethe quantity
Constraintdown to one variable
Differentiateset it equal to 0
Checkreject impossible x
Answerwhat 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

Your turn: eight questions

  • You may assume each is a max or min.
  • Write the model and the derivative.
GivenFind
1rectangle, perimeter 60maximum area
2P = −2x² + 48x − 100maximum profit
318 cm square cardmaximum box volume
4square base, 4000 cm³min surface, open top
5rectangle, area 100 m², width x mperimeter in terms of x
6box, V = x(24 − 2x)², V′ = 0 at x = 4, 12x for maximum V, and why
7C = 3x + 75/x, x > 0C″(5), nature at x = 5
8open cylinder, volume 1000π cm³r and h, least material
1
2
3
4
5
6
7
8
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.

Worked example

The answers: questions 1 and 2

  1. 1. 2x + 2y = 60, y = 30 − xperimeter
  2. A = x(30 − x) = 30x − x²
  3. dA/dx = 30 − 2x = 0, x = 15
  4. y = 15: A = 15 × 15 = 225 m²a square
  5. 2. dP/dx = −4x + 48differentiate
  6. −4x + 48 = 0, x = 12
  7. d²P/dx² = −4 < 0a maximum
  8. P = −288 + 576 − 100 = 188
Worked example

The answers: question 3

  1. 3. V = x(18 − 2x)²base 18 − 2x
  2. = 4x³ − 72x² + 324xexpand
  3. dV/dx = 12x² − 144x + 324differentiate
  4. = 12(x − 3)(x − 9) = 0factorise
  5. x = 9: base 18 − 18 = 0no box
  6. x = 3: V = 3(18 − 6)²
  7. = 3 × 144 = 432 cm³
Worked example

The answers: question 4

  1. 4. x²h = 4000, h = 4000/x²volume
  2. S = x² + 4xh = x² + 16 000/xsubstitute h
  3. dS/dx = 2x − 16 000/x² = 0
  4. 2x³ = 16 000, x³ = 8000multiply by x²
  5. x = 20, h = 4000/400 = 10
  6. S = 400 + 16 000/20
  7. = 400 + 800 = 1200 cm²
Your turn

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
  1. Draw it: three fences of length x (two ends and the divider) and two long sides of length y.
  2. Total fence: 3x + 2y = 300, so y = 150 − 3x2.
  3. Area: A = xy = x(150 − 3x2) = 150x − 3x²2. Now A is a function of x only.
  4. Differentiate: dAdx = 150 − 3x. At a maximum the gradient is zero: 150 − 3x = 0, so x = 50.
  5. Then y = 150 − 75 = 75.
  6. A = 50 × 75 = 3750 m². The second derivative is −3, which is negative, so this is the maximum.
  7. Check the fence: 3(50) + 2(75) = 150 + 150 = 300 m. Correct.
Full working
  1. 3x + 2y = 300, so y = 150 − 3x2
  2. A = 150x − 3x²2
  3. dAdx = 150 − 3x = 0, x = 50
  4. y = 75, A = 50 × 75d²Adx² = −3 < 0
  5. 3750 m²
Your turn

Sample questions: Merit

1

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
  1. There are two unknowns, x and the height h. The volume links them: 2x²h = 72, so h = 36x².
  2. A closed box has six faces. Top and bottom: 2 × 2x² = 4x². Two sides x by h: 2xh. Two sides 2x by h: 4xh.
  3. So S = 4x² + 6xh. Substitute h: S = 4x² + 6x(36x²) = 4x² + 216x.
  4. Write 216x as 216x⁻¹ to differentiate: dSdx = 8x − 216x⁻² = 8x − 216x².
  5. Set dSdx = 0: 8x = 216x², so 8x³ = 216 and x³ = 27. So x = 3.
  6. Then h = 369 = 4. The base is 3 cm by 6 cm.
  7. Show it is a minimum: d²Sdx² = 8 + 432x³, which is 8 + 16 = 24 at x = 3. Positive, so it is a minimum.
  8. S = 4(9) + 2163 = 36 + 72 = 108 cm².
  9. Check the volume: 3 × 6 × 4 = 72 cm³. Correct.
Full working
  1. 2x²h = 72, so h = 36x²volume constraint
  2. S = 4x² + 6xh = 4x² + 216x
  3. dSdx = 8x − 216x² = 0, x³ = 27, x = 3
  4. h = 369 = 4
  5. d²Sdx² = 8 + 432x³ = 24 > 0a minimum
  6. S = 36 + 72 = 108
  7. 3 cm by 6 cm by 4 cm high, S = 108 cm²
2

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
  1. A point on the curve is (x, √x). Its distance from (3, 0) is D = √((x − 3)² + (√x)²).
  2. D is smallest exactly where D² is smallest, because D is never negative. D² is easier to work with.
  3. D² = (x − 3)² + x = x² − 6x + 9 + x = x² − 5x + 9.
  4. Differentiate: d(D²)dx = 2x − 5. Set it to zero: x = 52.
  5. The second derivative is 2, which is positive, so this is a minimum.
  6. The point is (52, √(52)). Tidy the root: √(52) = √102.
  7. D² = (52)² − 5(52) + 9 = 254 − 504 + 364 = 114, so D = √112.
  8. 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
  1. D² = (x − 3)² + x = x² − 5x + 9point (x, √x)
  2. d(D²)dx = 2x − 5 = 0, x = 52
  3. second derivative 2 > 0a minimum
  4. y = √(52) = √102
  5. D² = 254 − 504 + 364 = 114
  6. (52, √102), shortest distance √112
Your turn

Sample questions: Excellence

1

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
  1. The volume of a cone is V = (13)πr²h. It has two variables, so we need a link between r and h.
  2. 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².
  3. Substitute: V = (13)π(144 − h²)h = (π3)(144h − h³). Using r² directly saves taking a square root.
  4. Differentiate: dVdh = (π3)(144 − 3h²).
  5. Set it to zero: 3h² = 144, so h² = 48 and h = √48 = 4√3. The height is positive, so ignore −4√3.
  6. Justify the maximum: d²Vdh² = (π3)(−6h) = −2πh. At h = 4√3 this is negative, so it is a maximum.
  7. Then r² = 144 − 48 = 96.
  8. V = (13)π(96)(4√3) = 128√3π cm³.
  9. 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
  1. r² + h² = 144, r² = 144 − h²right triangle
  2. V = (π3)(144h − h³)
  3. dVdh = (π3)(144 − 3h²) = 0, h² = 48
  4. h = 4√3h > 0
  5. d²Vdh² = −2πh < 0a maximum
  6. V = (13)π(96)(4√3) = 128√3π
  7. h = 4√3 cm, V = 128√3π cm³ ≈ 696.5 cm³
2

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
  1. Build the model first. Time for the trip = distance ÷ speed = 40v hours.
  2. The cost per hour, in dollars, is 0.5v² + 800. So the cost of the trip is C = (0.5v² + 800) × 40v.
  3. Simplify: C = 20v + 32000v. Write it as C = 20v + 32000v⁻¹ to differentiate.
  4. dCdv = 20 − 32000v².
  5. Set it to zero: 20v² = 32000, so v² = 1600 and v = 40. A speed is positive, so ignore −40.
  6. Show it is a minimum: d²Cdv² = 64000v³, which is positive for v > 0. So v = 40 gives a minimum.
  7. C = 20(40) + 3200040 = 800 + 800 = $1600.
  8. 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.
  9. 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
  1. time = 40v hours
  2. C = (0.5v² + 800) × 40v = 20v + 32000v
  3. dCdv = 20 − 32000v² = 0
  4. v² = 1600, v = 40v > 0
  5. d²Cdv² = 64000v³ > 0a minimum
  6. C = 800 + 800 = $1600
  7. 40 km per hour, $1600 per crossing

Challenge

1

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
  1. Cost = 2k × (two ends, 2πr²) + k × (side, 2πrh) = k(4πr² + 2πrh).
  2. The volume gives πr²h = 256π, so h = 256r², and the cost becomes k(4πr² + 512πr).
  3. Set the derivative to zero: 8πr = 512πr², so r³ = 64 and r = 4, h = 16.
  4. The second derivative is positive, so this is a minimum.
  5. With volume V the same steps give r³ = V4π, so h = Vπr² = Vπr³ × r = 4r.
Full working
  1. C = 2k(2πr²) + k(2πrh) = k(4πr² + 2πrh)ends cost double
  2. πr²h = 256π, so h = 256r²the volume constraint
  3. C = k(4πr² + 512πr⁻¹)one variable
  4. dCdr = k(8πr − 512πr⁻²)differentiate
  5. 8πr = 512πr², so r³ = 64, r = 4stationary
  6. h = 25616 = 16back into the constraint
  7. d²Cdr² = k(8π + 1024πr³) = 24πk > 0 at r = 4a minimum
  8. General V: dCdr = k(8πr − 2Vr²) = 0, so r³ = V4πsame method
  9. h = Vπr² = (Vπr³) × r = 4rVπr³ = 4
  10. r = 4 cm, h = 16 cm; and always h = 4r
2

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
  1. The height is 10sin θ, the top width is 10 + 20cos θ, and the base is 10.
  2. Area = half the sum of the parallel sides × height = 100sin θ(1 + cos θ).
  3. Differentiate with the product rule and replace sin²θ by 1 − cos²θ: a quadratic in cos θ.
  4. It factorises to (2cos θ − 1)(cos θ + 1) = 0, and only cos θ = 12 fits, so θ = π3.
  5. A semicircle of arc length 30 has radius 30π, so its area is (12)π(30π)² = 450π, which is bigger.
Full working
  1. height = 10sin θ, top = 10 + 20cos θeach side reaches out 10cos θ
  2. A = (12)(10 + 10 + 20cos θ)(10sin θ) = 100sin θ(1 + cos θ)trapezium
  3. dAdθ = 100(cos θ(1 + cos θ) − sin²θ)product rule
  4. = 100(2cos²θ + cos θ − 1)sin²θ = 1 − cos²θ
  5. = 100(2cos θ − 1)(cos θ + 1) = 0factorise
  6. cos θ = 12, θ = π3cos θ = −1 is outside the range
  7. d²Adθ² = 100(−sin θ − 4sin θ cos θ) = −150√3 < 0 at π3a maximum
  8. A = 100(√32)(32) = 75√3 ≈ 129.9 cm²substitute
  9. semicircle: πR = 30, R = 30π, area = (12)πR² = 450π ≈ 143.2 cm²larger
  10. θ = π3, area 75√3 ≈ 129.9 cm²; the semicircle (143.2 cm²) carries more
3

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
  1. The diagonal is the diameter, so d² = 3600 − w².
  2. Strength: S = w(3600 − w²), so dSdw = 3600 − 3w² = 0 gives w² = 1200 and d² = 2400.
  3. d²w² = 24001200 = 2, so d : w = √2 : 1, and d²Sdw² = −6w < 0 confirms a maximum.
  4. Stiffness: T = w(3600 − w²)^(32); the product and chain rules give dTdw = 4(900 − w²)√(3600 − w²).
  5. 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
  1. w² + d² = 60² = 3600the diagonal is a diameter
  2. S = w d² = w(3600 − w²) = 3600w − w³strength, one variable
  3. dSdw = 3600 − 3w² = 0, w² = 1200stationary
  4. w = 20√3, d² = 2400, d = 20√6d²Sdw² = −6w < 0, a maximum
  5. dw = √(24001200) = √2strongest ratio
  6. T = w d³ = w(3600 − w²)^(32)stiffness
  7. dTdw = (3600 − w²)^(32) + w × (32)(3600 − w²)^(12) × (−2w)product and chain rules
  8. = √(3600 − w²)(3600 − w² − 3w²) = 4(900 − w²)√(3600 − w²)common factor
  9. w = 30, d² = 2700, d = 30√3dTdw > 0 for w < 30, < 0 for w > 30
  10. dw = 30√330 = √3stiffest ratio
  11. strongest 20√3 by 20√6 (√2 : 1); stiffest 30 by 30√3 (√3 : 1)

More challenge problems

Practice

Practise this

Worksheet with answersWithout answersDownload PDF
2026 practice paper with worked answersOpen the paper
Report a mistake

More in AS 91578

Is your child on track?

Take the free placement test