25.6 Optimisation

SL 5.8 AHL 5.14

In this section you will learn
  • how to use derivatives to find the greatest or least value of a quantity in a practical problem
  • how to build the function to optimise from a diagram and a constraint
  • how to justify that a stationary value is a maximum or a minimum
  • AHL why you must also check the end points of the domain: sometimes the optimum is there

The method

Optimisation means finding the best value: the largest area, the smallest cost, the shortest distance, and so on. In 25.3 we used the first and second derivatives to find maximum and minimum points. Now we apply this to real problems.

Stationary values and their nature Not in the formula booklet

For \(y = f(x)\):

  • if \(\frac{dy}{dx} = 0\) at \(x = a\), there is a stationary point at \(x = a\) and \(f(a)\) is a stationary value of \(y\);
  • if \(\frac{dy}{dx} = 0\) and \(\frac{d^2y}{dx^2} < 0\) at \(x = a\), then \(f(a)\) is a maximum value of \(y\);
  • if \(\frac{dy}{dx} = 0\) and \(\frac{d^2y}{dx^2} > 0\) at \(x = a\), then \(f(a)\) is a minimum value of \(y\).
  • \(a\): the \(x\)-coordinate of the stationary point
  • \(\frac{d^2y}{dx^2}\): the second derivative of \(y\)

The formulae for areas and volumes (cylinder, cone, sphere, …) are in the booklet.

The steps:

  1. Draw a diagram and name the variables.
  2. Write the quantity to optimise (for example \(V\)) using the variables.
  3. Use the constraint (the fixed information) to write it in terms of one variable. State the domain.
  4. Differentiate and solve \(\frac{dV}{dx} = 0\).
  5. Justify that it is a maximum (or minimum): second derivative test or a sign diagram of \(\frac{dV}{dx}\).
  6. Answer the question that was asked (it may ask for \(V\), or for \(x\), or for something else), with units.

Example 1 A right circular cone with base radius \(r\) cm and height \(h\) cm is inscribed in a sphere of radius \(6\) cm, as in the cross-section below. The volume of the cone is \(V\) cm\(^3\).

(a) Show that \(r^2 = 12h - h^2\).

(b) Express \(V\) in terms of \(h\).

(c) Given that \(h\) can vary, find the value of \(h\) for which \(V\) is stationary.

(d) Show that this value of \(h\) gives the maximum volume, and find this maximum volume.

(a) The centre \(O\) is \(6\) cm below the vertex, so the base of the cone is \(h - 6\) cm below \(O\). A radius of the sphere goes from \(O\) to the edge of the base. By Pythagoras,

\[ r^2 + (h - 6)^2 = 6^2 \;\Rightarrow\; r^2 + h^2 - 12h + 36 = 36 \;\Rightarrow\; r^2 = 12h - h^2 . \]

(b) \(V = \frac{1}{3}\pi r^2 h = \frac{1}{3}\pi(12h - h^2)h = \frac{\pi}{3}(12h^2 - h^3)\), for \(0 < h < 12\).

(c) \(\frac{dV}{dh} = \frac{\pi}{3}(24h - 3h^2) = \pi h(8 - h)\). Since \(h > 0\), \(\frac{dV}{dh} = 0\) gives \(h = 8\).

(d) \(\frac{d^2V}{dh^2} = \frac{\pi}{3}(24 - 6h) = \pi(8 - 2h)\). At \(h = 8\): \(\frac{d^2V}{dh^2} = -8\pi < 0\), so it is a maximum.

\[ V_{\max} = \frac{\pi}{3}(12 \times 64 - 512) = \frac{\pi}{3} \times 256 = \frac{256\pi}{3} \approx 268 \text{ cm}^3 . \]

Example 2 At 9:00 a.m. ship \(A\) leaves port \(P\) and sails on a bearing of \(030°\) at \(12\) km h\(^{-1}\). At the same time ship \(B\) is \(70\) km due east of \(P\), sailing towards \(P\) at \(9\) km h\(^{-1}\).

(a) Show that the distance \(D\) km between the ships \(t\) hours after 9:00 a.m. is given by \(D = \sqrt{333t^2 - 2100t + 4900}\).

(b) Find the minimum value of \(D^2\) for \(t \ge 0\).

(c) At what time, to the nearest minute, are the ships closest together? How close are they?

(a) After \(t\) hours, \(PA = 12t\) and \(PB = 70 - 9t\). A bearing of \(030°\) makes an angle of \(60°\) with due east, so \(\angle APB = 60°\). By the cosine rule:

\[ \begin{aligned} D^2 &= (12t)^2 + (70 - 9t)^2 - 2(12t)(70 - 9t)\cos 60° \\ &= 144t^2 + 4900 - 1260t + 81t^2 - 840t + 108t^2 \\ &= 333t^2 - 2100t + 4900 . \end{aligned} \]

(b) \(D\) is smallest when \(D^2\) is smallest. \(\frac{d(D^2)}{dt} = 666t - 2100 = 0\) gives \(t = \frac{350}{111} \approx 3.153\). The second derivative is \(666 > 0\), so this is a minimum.

\[ D^2_{\min} = 333\left(\frac{350}{111}\right)^2 - 2100\left(\frac{350}{111}\right) + 4900 = \frac{176\,400}{111} \approx 1589 . \]

(c) \(0.153 \text{ h} \approx 9\) minutes, so the time is about 12:09 p.m. The least distance is \(\sqrt{1589.2} \approx 39.9\) km. (Check: \(B\) reaches \(P\) only at \(t = \frac{70}{9} \approx 7.8\), so the model is valid at \(t = 3.15\).)

Graphs page: enter \(f_1(x) = \sqrt{333x^2 - 2100x + 4900}\) (use \(x\) for \(t\)). Set the window, for example \(0 \le x \le 8\), \(0 \le y \le 80\). Choose Menu → Analyze Graph → Minimum, and click to the left and then to the right of the lowest point. The calculator shows the minimum at \(x \approx 3.15\), \(y \approx 39.9\).

You must still show the set-up (the function and its domain) in your working.

Example 3 AHL Two corridors meet at right angles. They are \(3\) m and \(2.4\) m wide. A long thin straight pipe \(AB\) is carried horizontally around the corner. In the position shown it touches the inner corner and makes an angle \(\theta\) with the walls of the narrower corridor.

(a) Show that the length of \(AB\) is \(L = 3\sec\theta + 2.4\csc\theta\).

(b) Show that \(\frac{dL}{d\theta} = 0\) when \(\tan^3\theta = 0.8\).

(c) Find \(L\) for this value of \(\theta\). Explain what this value means.

(a) The inner corner divides \(AB\) into two parts. In the \(3\) m corridor, \(\cos\theta = \frac{3}{\text{part}}\), so this part is \(\frac{3}{\cos\theta} = 3\sec\theta\). In the \(2.4\) m corridor, \(\sin\theta = \frac{2.4}{\text{part}}\), so this part is \(2.4\csc\theta\). Add them.

(b) \(\frac{dL}{d\theta} = 3\sec\theta\tan\theta - 2.4\csc\theta\cot\theta = \frac{3\sin\theta}{\cos^2\theta} - \frac{2.4\cos\theta}{\sin^2\theta}\).

Setting this to \(0\): \(3\sin^3\theta = 2.4\cos^3\theta\), so \(\tan^3\theta = \frac{2.4}{3} = 0.8\).

(c) \(\theta = \arctan\sqrt[3]{0.8} \approx 0.748\) rad (\(\approx 42.9°\)). Then \(L \approx 7.62\) m.

As \(\theta \to 0\) or \(\theta \to \frac{\pi}{2}\), \(L \to \infty\), so this stationary value is the minimum of \(L\). A pipe can turn the corner only if it fits in every position, so the longest pipe that can be carried around the corner is about \(7.62\) m.

AHL 5.14 When the optimum is at an end point

A stationary point gives a local maximum or minimum. In a practical problem the variable often has a restricted domain \(a \le x \le b\). The greatest or least value may then be at an end point, where \(f'(x)\) need not be zero.

Global maximum and minimum on \([a, b]\)

Find \(f\) at every stationary point and at \(x = a\) and \(x = b\). The largest of these values is the global maximum, and the smallest is the global minimum.

Example 4 A wire of length \(40\) cm is cut into two pieces. A piece of length \(x\) cm is bent into a square, and the rest is bent into a circle.

(a) Show that the total area enclosed is \(A = \dfrac{x^2}{16} + \dfrac{(40 - x)^2}{4\pi}\), for \(0 \le x \le 40\).

(b) Find the value of \(x\) that gives the minimum total area.

(c) How should the wire be used to make the total area as large as possible?

(a) Square: side \(\frac{x}{4}\), area \(\frac{x^2}{16}\). Circle: \(2\pi r = 40 - x\), so \(r = \frac{40 - x}{2\pi}\) and the area is \(\pi r^2 = \frac{(40 - x)^2}{4\pi}\).

(b) \(\frac{dA}{dx} = \frac{x}{8} - \frac{40 - x}{2\pi} = 0 \Rightarrow \pi x = 4(40 - x) \Rightarrow x = \frac{160}{\pi + 4} \approx 22.4\) cm.

\(\frac{d^2A}{dx^2} = \frac{1}{8} + \frac{1}{2\pi} > 0\), so this is a minimum (area \(\frac{400}{\pi + 4} \approx 56.0\) cm\(^2\)).

(c) The only stationary point is a minimum, so the maximum must be at an end point:

\[ A(0) = \frac{1600}{4\pi} = \frac{400}{\pi} \approx 127 \text{ cm}^2, \qquad A(40) = \frac{1600}{16} = 100 \text{ cm}^2 . \]

The largest area is \(\frac{400}{\pi}\) cm\(^2\), when \(x = 0\): do not cut the wire; bend all of it into a circle.

Common errors

✗ Wrong ✓ Right Why
Differentiating a function of two variables Use the constraint to remove one variable first You can only differentiate a function of one variable here.
Stopping at \(\frac{dV}{dx} = 0\) Justify max/min (second derivative or sign diagram) “Show that it is a maximum” needs a reason.
Giving \(x\) when the question asks for the maximum area Substitute back and answer the question Read the last line of the question again.
Ignoring the domain Check end points and the physical domain The optimum may be at an end point, and lengths must be positive.
Minimising \(D\) with a messy square root Minimise \(D^2\) instead \(D\) and \(D^2\) have their minimum at the same \(t\) (for \(D \ge 0\)).

Exercises

1 Two positive numbers \(x\) and \(y\) have \(x + y = 20\). Find the maximum value of \(x^2y\).

\(P = x^2(20 - x) = 20x^2 - x^3\). \(\frac{dP}{dx} = 40x - 3x^2 = x(40 - 3x) = 0 \Rightarrow x = \frac{40}{3}\).

\(\frac{d^2P}{dx^2} = 40 - 6x = -40 < 0\): maximum. \(y = \frac{20}{3}\), \(P = \frac{1600}{9} \times \frac{20}{3} = \frac{32\,000}{27} \approx 1185\).

2 A farmer has \(120\) m of fencing to make a rectangular pen against a long straight wall (the wall forms one side). Find the maximum area.

Let the two sides perpendicular to the wall be \(x\) m. The third side is \(120 - 2x\) m. \(A = x(120 - 2x) = 120x - 2x^2\).

\(\frac{dA}{dx} = 120 - 4x = 0 \Rightarrow x = 30\); \(\frac{d^2A}{dx^2} = -4 < 0\). Maximum area \(30 \times 60 = 1800\) m\(^2\).

3 An open box is made from a square sheet of card \(24\) cm by \(24\) cm by cutting a square of side \(x\) cm from each corner and folding up the sides. Find the value of \(x\) that gives the maximum volume, and the maximum volume.

\(V = x(24 - 2x)^2\), \(0 < x < 12\).

\(\frac{dV}{dx} = (24 - 2x)^2 - 4x(24 - 2x) = (24 - 2x)(24 - 6x) = 0 \Rightarrow x = 4\) (since \(x \neq 12\)).

Sign of \(\frac{dV}{dx}\): \(+\) for \(0 < x < 4\), \(-\) for \(4 < x < 12\): maximum. \(V = 4 \times 16^2 = 1024\) cm\(^3\).

4 A closed cylinder has volume \(250\pi\) cm\(^3\). Find the radius and height that make its total surface area as small as possible, and find this area.

\(\pi r^2 h = 250\pi \Rightarrow h = \frac{250}{r^2}\). \(S = 2\pi r^2 + 2\pi r h = 2\pi r^2 + \frac{500\pi}{r}\).

\(\frac{dS}{dr} = 4\pi r - \frac{500\pi}{r^2} = 0 \Rightarrow r^3 = 125 \Rightarrow r = 5\), \(h = 10\).

\(\frac{d^2S}{dr^2} = 4\pi + \frac{1000\pi}{r^3} > 0\): minimum. \(S = 50\pi + 100\pi = 150\pi \approx 471\) cm\(^2\).

5 A company’s weekly profit from making \(x\) hundred items is \(P(x) = -x^3 + 15x^2 + 72x - 500\) dollars, \(0 \le x \le 20\). Find the number of items that gives the maximum profit, and the maximum profit.

\(P'(x) = -3x^2 + 30x + 72 = -3(x^2 - 10x - 24) = -3(x - 12)(x + 2)\). In the domain, \(x = 12\).

\(P''(x) = -6x + 30 = -42 < 0\) at \(x = 12\): maximum. (End points: \(P(0) = -500\), \(P(20) = -1060\), both smaller.)

\(1200\) items; \(P(12) = -1728 + 2160 + 864 - 500 = 796\) dollars.

6 Find the coordinates of the point on the curve \(y = \sqrt{x}\) that is closest to the point \((4, 0)\), and find this shortest distance.

\(D^2 = (x - 4)^2 + (\sqrt{x})^2 = x^2 - 7x + 16\).

\(\frac{d(D^2)}{dx} = 2x - 7 = 0 \Rightarrow x = \frac{7}{2}\) (second derivative \(2 > 0\): minimum).

Point \(\left(\frac{7}{2}, \sqrt{\frac{7}{2}}\right)\). \(D^2 = \frac{49}{4} - \frac{49}{2} + 16 = \frac{15}{4}\), so \(D = \frac{\sqrt{15}}{2} \approx 1.94\).

7 A rectangle has two vertices on the \(x\)-axis and two on the curve \(y = 12 - x^2\) (above the axis). Find the maximum area of the rectangle.

Vertices \((\pm x, 12 - x^2)\) with \(0 < x < \sqrt{12}\). \(A = 2x(12 - x^2) = 24x - 2x^3\).

\(\frac{dA}{dx} = 24 - 6x^2 = 0 \Rightarrow x = 2\); \(\frac{d^2A}{dx^2} = -12x = -24 < 0\). Maximum area \(= 4 \times 8 = 32\).

8 A fly moves so that its position after \(t\) seconds is \((2t,\; 3 - t,\; 1 + t)\) metres, \(t \ge 0\).

(a) Show that its distance \(D\) m from the origin satisfies \(D^2 = 6t^2 - 4t + 10\).

(b) Find the shortest distance from the origin.

(a) \(D^2 = 4t^2 + (9 - 6t + t^2) + (1 + 2t + t^2) = 6t^2 - 4t + 10\).

(b) \(\frac{d(D^2)}{dt} = 12t - 4 = 0 \Rightarrow t = \frac{1}{3}\) (minimum, since \(12 > 0\)).

\(D^2 = \frac{6}{9} - \frac{4}{3} + 10 = \frac{28}{3}\), so \(D = \sqrt{\frac{28}{3}} \approx 3.06\) m.

9 AHL A picture on a wall has its bottom edge \(1\) m and its top edge \(4\) m above a viewer’s eye level. The viewer stands \(x\) m from the wall. The angle \(\theta\) subtended by the picture at the eye is \(\theta = \arctan\frac{4}{x} - \arctan\frac{1}{x}\).

(a) Show that \(\frac{d\theta}{dx} = \frac{1}{x^2 + 1} - \frac{4}{x^2 + 16}\).

(b) Find the distance \(x\) that gives the largest viewing angle, and this angle.

(a) \(\frac{d}{dx}\arctan\frac{a}{x} = \frac{1}{1 + \frac{a^2}{x^2}} \times \left(-\frac{a}{x^2}\right) = -\frac{a}{x^2 + a^2}\). So \(\frac{d\theta}{dx} = -\frac{4}{x^2 + 16} + \frac{1}{x^2 + 1}\).

(b) \(\frac{1}{x^2 + 1} = \frac{4}{x^2 + 16} \Rightarrow x^2 + 16 = 4x^2 + 4 \Rightarrow x^2 = 4 \Rightarrow x = 2\).

For \(x < 2\), \(\frac{d\theta}{dx} > 0\); for \(x > 2\), \(\frac{d\theta}{dx} < 0\): maximum.

\(\tan\theta = \frac{2 - \frac{1}{2}}{1 + 2 \times \frac{1}{2}} = \frac{3}{4}\), so \(\theta = \arctan\frac{3}{4} \approx 0.644\) rad (\(\approx 36.9°\)).

10 AHL Find the global maximum and global minimum values of \(f(x) = x^3 - 12x + 1\) on the interval \(-3 \le x \le 5\).

\(f'(x) = 3x^2 - 12 = 0 \Rightarrow x = \pm 2\): \(f(-2) = 17\), \(f(2) = -15\).

End points: \(f(-3) = -27 + 36 + 1 = 10\), \(f(5) = 125 - 60 + 1 = 66\).

Global maximum \(66\) at \(x = 5\) (an end point, not the local maximum); global minimum \(-15\) at \(x = 2\).