Subsections


2.3 General Approach


\begin{displaymath}
\epsffile{optx1g4.eps}
\end{displaymath}

If you do not know a priori that the ladder hits the wall, you can follow the general approach.

There are now two degrees of freedom. They are conveniently taken to be $h$ and $d$.

Then the length of the ladder is, (from Pythagoras),

\begin{displaymath}
\ell(h,d)=\sqrt{h^2 + d^2}
\end{displaymath}

We now need to figure out what values of $h$ and $d$ produce the shortest ladder.


2.3.1 Formulation


\begin{displaymath}
\epsffile{optx1g4.eps}
\end{displaymath}

Note that by the definition of the problem, $h$ $\raisebox{.3pt}{$>$}$ 8 and $d$ $\raisebox{.3pt}{$>$}$ $3\frac38$. But these constraints are not precise. For example, $h$ $\vphantom0\raisebox{1.5pt}{$=$}$ 8.001 and $d$ $\vphantom0\raisebox{1.5pt}{$=$}$ $3\frac38+0.001$ would obviously have the ladder go through the wall.

There is a precise constraint, that the ladder cannot pass through the wall. If $b$ is the height of the point on the ladder straight above the wall, then similar triangles give:

\begin{displaymath}
\frac{b}{d-3\frac38} = \frac{h}{d} \; (= \tan\phi)
\end{displaymath}

The constraint is that $b$ $\raisebox{-.5pt}{$\geqslant$}$ 8, so:

\begin{displaymath}
h \frac{d - {\textstyle 3\frac38}}{d} \ge 8
\quad\quad\Rightarrow\quad\quad h [d - 3\frac38] - 8d \ge 0
\end{displaymath}

Note that this is in general an inequality constraint. Equality occurs when the ladder hits the wall.

So the problem is to minimize

\begin{displaymath}
\ell(h,d)=\sqrt{h^2 + d^2}
\end{displaymath}

(from Pythagoras), subject to the inequality constraint

\begin{displaymath}
h [d - {\textstyle 3\frac38}] - 8d \ge 0
\end{displaymath}

To solve this, first plot the possible $h$ and $d$ values:

\begin{displaymath}
\epsffile{optx1g5.eps}
\end{displaymath}

Plotting the curve where equality occurs in the constraint gives the bottom of the grey region above. On that curve, the ladder hits the wall. If you go above the curve, into the grey region, $h$ becomes bigger and the ladder then moves above the wall.

Now you must figure out whether the shortest ladder occurs in the strict interior of the grey region or on its boundary. Try the interior first.


2.3.2 Interior minima


\begin{displaymath}
\epsffile{optx1g5.eps}
\end{displaymath}

For a minimum, at least locally, in the strict interior of the grey region, the partial derivatives must be zero.

\begin{displaymath}
\frac{\partial\ell}{\partial d} = (h^2 + d^2)^{-1/2}d = 0 ...
...ad
\frac{\partial\ell}{\partial h} = (h^2 + d^2)^{-1/2}h =0
\end{displaymath}

But these two requirements can only be true if $d$ $\vphantom0\raisebox{1.5pt}{$=$}$ $h$ $\vphantom0\raisebox{1.5pt}{$=$}$ 0, and that point is not in the grey region. So there is no interior minimum (or maximum, for that matter).


2.3.3 Boundary minima


\begin{displaymath}
\epsffile{optx1g5.eps}
\end{displaymath}

Since the minimum is not in the interior, it must be on the boundary of the grey region. Now obviously for infinite $h$ or $d$ or both you do not have the shortest ladder. So the minimum cannot be on the boundary at infinity. It must be on the curve where the ladder just hits the wall.

But how do we find the minimum on this line? The partial derivatives of $\ell$ are not zero at this point. (Just check that out in the previous subsection.)

The trick is to define an artificial third variable $\lambda$, called a Lagrangian multiplier, corresponding to the constraint. (In the most general case, this Lagrangian multiplier has no particular physical meaning.) Then define a new function $f$ to replace $\ell$ in the minimization:

\begin{displaymath}
f = \sqrt{h^2 + d^2} + \lambda (h [d - {\textstyle 3\frac38}] - 8d).
\end{displaymath}

Note that $\lambda$ multiplies whatever is zero according to the constraint.

Now it turns out that you can find the desired minimum by finding an unconstrained stationary point to this function $f$:

\begin{eqnarray*}
& \partial f/\partial d = (h^2 + d^2)^{-1/2}d + \lambda (h -...
...ial f/\partial \lambda = h [d - {\textstyle 3\frac38}] - 8d = 0
\end{eqnarray*}

From the first two equations

\begin{displaymath}
(h^2 + d^2)^{-1/2}d = - \lambda (h - 8) \qquad
(h^2 + d^2)^{-1/2}h = - \lambda (d - {\textstyle 3\frac38})
\end{displaymath}

or taking the ratio of these two equations,

\begin{displaymath}
\frac{d}{h} = \frac{h-8}{d - 3\frac38}
\end{displaymath}

Solving the constraint for $h$ and putting it in the above gives after simplification:

\begin{displaymath}
(d-3{\textstyle\frac{3}{8}})^3 = 8\times 27 \quad\quad\Rig...
...ad\quad\Rightarrow\quad\quad \ell = {\textstyle\frac{125}{8}}
\end{displaymath}

If you would have more than one constraint, there is one separate Lagrangian multiplier for each one. For example, if you take care of the boundary conditions in a finite element computation this way, you will get one for each boundary condition at each boundary point.