Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose we have a ladder (with a unit length) and we want to position it to reach the highest point possible on a vertical wall. The terrain is sloped and can be described with a variable k. What is the optimal distance from the wall the ladder should be placed at, so the point reached is the highest?

See the picture, we are looking for x.

enter image description here

I've concluded, "experimentally", that the ladder should be placed vertical to the terrain, but I've been unable to prove it. I didn't how to set a Lagrange correctly. (and yes, this was an exam question, I don't plan on scaling any walls!)

share|cite|improve this question
D'oh! That was easy! I feel so silly now. – VPeric Jan 7 '13 at 20:42
up vote 4 down vote accepted

This seems to be a very straightforward calculus I problem, so I'll present my solution in that manner. We can define a function $h(x)=kx+\sqrt{1-x^2}$ so that $h(x)$ is the height of the ladder according to the wall. With this in mind, we calculate $$h'(x)=k-\frac{x}{\sqrt{1-x^2}}.$$ Setting this to zero and solving, we get that $$x=\pm\sqrt{\frac{k^2}{k^2+1}}.$$ Since a negative value for $x$ is inappropriate for this type of problem, we throw out the solution that doesn't make sense, and we have as our final answer $$x=\sqrt{\frac{k^2}{k^2+1}}.$$

share|cite|improve this answer
Just as an aside, the discarded value of $x$ is not inappropriate, it just corresponds to the minimum rather than the maximum. – copper.hat Jan 8 '13 at 6:22

Alternatively look at it like this. Take a point on the wall. What is the shortest ladder which reaches that point? Clearly one perpendicular to the ground (shortest line between ground and point). If the ladder is not perpendicular to the ground, we can reach the same point with a shorter ladder, which is perpendicular, and place our longer ladder higher up and parallel.

share|cite|improve this answer
This wins the prize for elegance, surely! – Peter Smith Jan 8 '13 at 0:05
It has a dual elegance... – copper.hat Jan 8 '13 at 0:15
always nice to find the correct answer the teacher didn't expect... – long tom Jan 8 '13 at 12:11

Yet another solution:

The top of the ladder is at $(x+\cos \theta,kx+\sin \theta)$, where $\theta$ is the anti-clockwise angle from the $x$ axis. The problem is then $\max_{\theta, x} \{ kx + \sin \theta | x + \cos \theta = 0 \}$. The constraint bounds $|x|$ by $1$, and the problem is equivalent to $\max_{\theta, x} \{ kx + \sin \theta | x + \cos \theta = 0,\ \theta \in [0,2 \pi] \}$, hence the feasible set may be taken to be compact and non-empty, hence a solution exists.

Then we use Lagrange to characterize the solutions: $$ \binom{k}{\cos \theta} + \lambda \binom{1}{-\sin \theta} = 0$$ which reduces to $\cos \theta = - k \sin \theta$. Squaring and using the identity $\cos^2 x + \sin^2 x = 1$ gives $\sin \theta = \pm \frac{1}{\sqrt{1+ k^2}}$, and the Lagrange condition then gives $\cos \theta = \mp \frac{k}{\sqrt{1+ k^2}}$, and hence the constraint gives $x = \pm \frac{k}{\sqrt{1+ k^2}}$. Choosing the higher objective value, we have the solution $x = \frac{k}{\sqrt{1+ k^2}}$, with optimal value $\sqrt{k^2+1}$.

To confirm your intuition: If we let $\alpha$ satisfy $\cos \alpha = \frac{1}{\sqrt{1+ k^2}}$, $\sin \alpha = \frac{k}{\sqrt{1+ k^2}}$, then we see that if $\theta$ is the optimal angle, then $\theta = \alpha + \frac{\pi}{2}$ (modulo $2 \pi$, of course).

share|cite|improve this answer

The height reached is $kx$ plus the "extra height" which is, by the Pythagorean Theorem, $\sqrt{1-x^2}$.

So we want to maximize $f(x)=kx+\sqrt{1-x^2}$. As usual, find where $f'(x)=0$. Compare with any endpoint candidates. (In the case of $0$ or negative slope, a vertical ladder is optimal, though unpleasantly dangerous.)

share|cite|improve this answer
I believe the proposer means that ladder is perpendicular to the slanted terrain. – Maesumi Jan 7 '13 at 22:29
@Maesumi: My comment at the end referred to the endpoint issue. – André Nicolas Jan 7 '13 at 22:33

At the optimal configuration, we have $\mathrm dh/\mathrm dx = 0$, that is, moving the foot of the ladder a small amount will not change the height of the top. Conversely, what is the configuration such that if you keep the top fixed and nudge the ladder slightly, its foot remains on the terrain? Only when the ladder is perpendicular to the terrain. The solution follows.

share|cite|improve this answer

$M$ is the endpoint of the ladder on the $y$-axis. $T$ is the endpoint of the ladder on the ground. Draw a circle with center $M$ through the ther endpoint $T$ of the ladder. The radius of the circle is the length of the ladder. If t he ground is tangent to the circle then the height of $M$ is maximal.

The radius (the ladder) is normal to the tangent (the ground). The angle $\angle(TMO)$ is equal to the angle between the $x$-axis and the ground. So $\overline{OT}=k$ and the height $\overline{OM}$ can be calculated using the Pythagorean theorem as $\sqrt{1+k^2}$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.