5.8 Optimization
In problems of optimization, we have to construct a function in terms of some variable $x$, and then we use derivatives to find the "optimum" solution, that is the maximum or the minimum value of the function.
EXAMPLE 1
Among all the rectangles of perimeter 20, find the one of the maximum area.
A rectangle of perimeter 20 may have dimensions:
The corresponding areas are:
Which is the one of the maximum area?
Let $x$ be one of the sides (this will be our main variable). If the other side is $y$, then the perimeter is 20:
$$2x + 2y = 20 \implies y = 10 - x$$The function of optimisation is Area:
$$A = xy = x(10 - x) = 10x - x^2$$We find the derivative:
$$\frac{dA}{dx} = 10 - 2x$$Stationary points:
$$\frac{dA}{dx} = 0 \iff 10 - 2x = 0 \iff x = 5$$The 2nd derivative test is easier here: $A'' = -2$. At $x = 5$, $A'' < 0$ thus we have a maximum value there.
Therefore, the rectangle of maximum area is the square (that is when $x = 5$), and the maximum area is $A_{max} = 25$.
Let's reverse the role of the perimeter and the area. Next we know the area of the rectangle and we are looking for the minimum perimeter.
EXAMPLE 2
Among all the rectangles of area 25, find the one of the minimum perimeter.
Again, let $x$ be one of the sides (this will be our main variable). If the other side is $y$, then the area is 25:
$$xy = 25 \implies y = \frac{25}{x}$$The function of optimisation is Perimeter:
$$P = 2x + 2y = 2x + \frac{50}{x} \implies \frac{dP}{dx} = 2 - \frac{50}{x^2}$$Stationary points:
$$\frac{dP}{dx} = 0 \iff 2 - \frac{50}{x^2} = 0 \iff x^2 = 25 \iff x = 5$$The 2nd derivative test gives $P'' = \dfrac{100}{x^3}$. For $x = 5$, $P'' > 0$, thus we have a minimum value there.
Therefore, the rectangle of minimum perimeter is the square, (that is when $x = 5$), and the minimum perimeter is $P_{min} = 20$.
Sometimes, there is a different "cost" for each side.
EXAMPLE 3
We want to construct a rectangle fence for an area of 24 m², but the cost for the material of the front side is 10 per meter while the cost for the material of the other 3 sides is 5 per meter. Find the cheapest solution
Let $x$ be the front side. If the other side is $y$, then the area is 24:
$$xy = 24 \implies y = \frac{24}{x}$$The function of optimisation is Cost:
$$C = 10x + 5x + 2(5y) = 15x + 10y = 15x + \frac{240}{x}$$We find the derivative:
$$\frac{dC}{dx} = 15 - \frac{240}{x^2}$$Stationary points:
$$\frac{dC}{dx} = 0 \iff 15 - \frac{240}{x^2} = 0 \iff x^2 = 16 \iff x = 4$$The 2nd derivative test gives: $C'' = \dfrac{480}{x^3}$. For $x = 4$, $C'' > 0$, thus we have a minimum value there.
Therefore, the best rectangle has dimensions $4 \times 6$ and the minimum cost is $C_{min} = \$120$.
Let's see an example of a shape determined by the boundaries of a given function!
EXAMPLE 4
Consider the region enclosed by $y = 9 - x^2$ and the x-axis. Find the rectangle of largest area inscribed within that region.
There are two extreme cases:
- the height of the rectangle is 0, the width is 6. The area is 0.
- the height of the rectangle is 9, the width is 0. The area is 0.
Somewhere in between there is a rectangle of maximum area.
Solution:Key point: Let $a$ be the x-coordinate of the bottom right corner. Then
$$ \text{Width} = 2a $$ $$ \text{Height} = y = 9 - a^2$$Thus, the function of optimisation is Area
$$A = 2a(9 - a^2) = 18a - 2a^3$$We find the derivative
$$\frac{dA}{da} = 18 - 6a^2$$Stationary points:
$$\frac{dA}{da} = 0 \iff 18 - 6a^2 = 0 \iff a^2 = 3 \iff a = \sqrt{3}$$The 2nd derivative test gives: $A'' = -12a$. At $a = \sqrt{3}$, $A'' < 0$ thus we have a maximum value there.
Therefore, the rectangle of maximum area has dimensions $2\sqrt{3} \times 6$ and the maximum area is $A_{max} = 12\sqrt{3}$.
EXAMPLE 5
A swimmer is at point A inside the sea, 3 km away from the beach. She wants to go to point B at the beach, which is 5 km away.
- When she swims she covers 1 km in 30 minutes.
- When she runs she covers 1 km in 15 minutes.
Find:
- (a) the time she spends when she swims directly to B;
- (b) the time she spends when she swims to C and then runs to B;
- (c) the minimum time she can achieve if she swims first to some point D between B and C and then runs to B.
(c) Let $D$ be between $C$ and $B$ and $CD = x$ km. Then $DB = 4 - x$ km. Also:
$$AD^2 = AC^2 + CD^2 \implies AD = \sqrt{9 + x^2}$$Therefore, the function of optimization is the total time (in minutes):
$$T = T_{AD} + T_{DB} = 30\sqrt{9 + x^2} + 15(4 - x) = 30\sqrt{9 + x^2} - 15x + 60$$We find the derivative:
$$\frac{dT}{dx} = \frac{30x}{\sqrt{9 + x^2}} - 15$$Stationary points:
$$ \begin{aligned} \frac{dT}{dx} = 0 &\iff \frac{30x}{\sqrt{9 + x^2}} - 15 = 0 \iff 30x = 15\sqrt{9 + x^2} \\ &\iff 2x = \sqrt{9 + x^2} \iff 4x^2 = 9 + x^2 \iff 3x^2 = 9 \\ &\iff x^2 = 3 \iff x = \sqrt{3} \approx 1.73 \end{aligned} $$We can easily verify that this is a minimum (2nd derivative test). Thus, the point $D$ is $1.73$ km from $C$.
The minimum time is $T_{min} = 45\sqrt{3} + 60 \approx 138$ minutes.