A very classic (if somewhat artificial and contrived) example of an optmization problem is maximing the area of a rectangle with fixed perimeter. Let’s say that \(P\) is the fixed perimeter and the rectangle has height \(h\) and length \(l\text{,}\) as in Figure 10.2.2.
I want to maximize area, so I will eventually be differentiating an area function. However, the area function is \(A = ab\text{,}\) which has two variables. I need to use the perimeter restriction to eliminate one of the variables. I know \(P = 2a + 2b\) so \(a = \frac{P}{2}
- b\text{.}\) If I substitute for \(a\) in the area function, I get a single variable area function \(A(b)\text{.}\)
\begin{equation*}
A(b) = b \left( \frac{P}{2} - b \right)
\end{equation*}
Then I can optimize. The derivative is \(A^\prime(b) =
\frac{P}{2} - 2b\text{.}\) This vanishes when \(b =
\frac{P}{4}\text{.}\) I can test that the critical point is a maximum. Unsurprisingly, the result shows that a square (where both \(b\) and \(a\) are exactly one quarter of the perimeter) maximizes area.