#math/calculus
Optimization problems follow one pattern: identify the objective, write the constraints, reduce the objective to one variable with its feasible interval, find all candidates, and interpret the winning value in the original units.
## Rectangles inscribed in a circle
For a rectangle inscribed in a circle of radius $1$, the diagonal is $2$, so its side lengths satisfy $\ell^{2}+w^{2}=4$.
![[tikz-50ba823db9a3.svg]]
%% tikz-source
```latex
\begin{document}
\begin{tikzpicture}[scale=1.05,line cap=round]
\draw[very thick,blue] (0,0) circle (2);
\draw[very thick] (-1.414,-1.414) rectangle (1.414,1.414);
\draw[dashed,red!75!black] (-1.414,-1.414) -- (1.414,1.414) node[midway,above left] {$2$};
\node[below] at (0,-1.414) {$\ell$};
\node[right] at (1.414,0) {$w$};
\fill (0,0) circle (1.6pt);
\end{tikzpicture}
\end{document}
```
%%
Since $2\ell w\le \ell^{2}+w^{2}=4$, the area satisfies $A=\ell w\le2$, with equality only when $\ell=w=\sqrt2$. Also $(\ell+w)^{2}=4+2\ell w$, so the same square gives the largest perimeter, $4\sqrt2$.
## Minimum-cost box
A closed rectangular box has height $1$, volume $2$, bottom cost $10$, side cost $5$, and top cost $7$ cents per square meter. If its base is $\ell\times w$, then $\ell w=2$ and
$
C=10\ell w+7\ell w+10\ell+10w
=34+10\ell+\frac{20}{\ell},\qquad \ell>0.
$
Now $C'(\ell)=10-20/\ell^{2}$ and $C''(\ell)=40/\ell^{3}>0$, so the minimum occurs at $\ell=\sqrt2$. Thus $\ell=w=\sqrt2$ and the box is $\sqrt2\times\sqrt2\times1$.
## Stiffest beam from a circular log
Let a rectangular beam cut from a log of diameter $d$ have breadth $b$ and thickness $t$. The constraint is $b^{2}+t^{2}=d^{2}$, while stiffness is proportional to $bt^{3}$. Therefore maximize $F(t)=t^{3}\sqrt{d^{2}-t^{2}}$. Since
$
F'(t)=\frac{t^{2}(3d^{2}-4t^{2})}{\sqrt{d^{2}-t^{2}}},
$
the maximum occurs at $t=\sqrt3d/2$ and $b=d/2$.
## Profit and marginal quantities
If profit is $P(x)=R(x)-C(x)$, then an interior profit maximum satisfies $P'(x)=0$, hence **marginal revenue equals marginal cost**: $R'(x)=C'(x)$. For
$C(x)=800+30x-0.01x^{2}$ and $R(x)=50x-0.02x^{2}$ on $0<x\le1500$, we get $P'(x)=20-0.02x$. The maximum occurs at $x=1000$, where $P(1000)=9200$.
## Arithmetic–geometric mean inequality
For $a>0$, minimize $f(x)=(a+x)/\sqrt{ax}$ on $x>0$. Its derivative has the sign of $x-a$, so the minimum occurs at $x=a$ and equals $2$. Replacing $x$ by $b>0$ gives
$
\frac{a+b}{2}\ge\sqrt{ab},
$
with equality exactly when $a=b$.
> [!Practice]
> Marsden & Weinstein, p. 190, exercises 61–77.