# How do I solve this optimization question?

A fence 8 feet tall runs parallel to a tall building at a distance of 2 feet from the building. What is the length of the shortest ladder that will reach from the ground over the fence to the wall of the building?

My Work

Let $y$ represent the horizontal distance from the fence to the bottom of the ladder. Let $x$ represent the vertical distance from the building to the top of the fence.

Then, the solution would be the local minimum of the function:

$L = (x+8)^2 + (y+2)^2$

with the constraint:

$$\frac{x+8}{y+2} = \frac{8}{y}$$

Finding the derivative of the function gives:

$L ^\prime = -x^4 - x^3 + 256x + 512$

I am not allowed to use a calculator, so how do I find the shortest length?

Thanks

• As I understand the question, you are asked to express the length of the ladder in terms of the length of the building. – Arthur Nov 12 '13 at 3:45
• Check whether you have swapped $x$ and $y$ in your equations! – Macavity Nov 12 '13 at 4:05
• @Macavity Oops, yes I did. Fixed it. – asd Nov 12 '13 at 4:09

## 2 Answers

It is clear that the shortest ladder will lean against the fence. Poor fence!

Let $t$ be the angle the ladder makes with the ground. Then the distance from the foot of the ladder to the bottom of the fence is $8\cot t$. Thus the distance of the foot of the ladder to the building is $2+8\cot t$. It follows that the ladder has length $L(t)=(2+8\cot t)\sec t$. This can be expressed as $$L(t)=\frac{2}{\cos t} +\frac{8}{\sin t}.$$ Differentiation gives $$L'(t)=\frac{2\sin t}{\cos^2 t} -\frac{8\cos t}{\sin^2 t}.$$ Set $L'(t)$ equal to $0$, solve. We get $\tan t=\sqrt{4}$. Since $L'(t)\lt 0$ for $t\lt \sqrt{4}$, and positive for $t\gt \sqrt{4}$, we do attain a minimum at $t=\sqrt{4}$.

I get the following equations using your approach: $$L = (x+2)^2+(y+8)^2, \qquad \frac{y+8}{x+2}= \frac8x$$

The similarity constraint quickly gives $y = \dfrac{16}x$. Using this, we have the square of the ladder length as $$L = x^2+4x+\frac{256}x + \frac{256}{x^2}+68$$

and we can get $L'$ in a factored form (after identifying the factor $(x+2)$ by inspection, $$L' = 2 \frac{(x^3-128)(x+2)}{x^3}$$

Now can you see for what value of $x$ we can get a minimum for the ladder length?