This is a problem from Riley-Hobson "Mathematical Methods For Physics And Engineering".

QUESTION: Two horizontal corridors, $0\le x \le a$ with $y\ge 0$ and $0\le y \le b$ with $x\ge 0$, meet at right angles. Find the length of the longest ladder that can be moved around the corner of the corridor. Use Lagrange Multipliers to solve the problem.

I checked the following questions.

  1. Longest pipe that fits around a corner.

  2. Intuitive explanation for formula of maximum length of a pipe moving around a corner?

that are almost similar.

However I found only one solution which had an approach of Lagrange multipliers.

In that solution, the author writes as follows:

For example, if we rephrase the question as

Find the length of the shortest line segment from $(x,0)$ to $(0,y)$ that passes through $(a,b)$.

then with a little coordinate geometry we can rephrase it again as

Minimize $(x^2+y^2)^{1/2}$ subject to the constraint $\frac ax + \frac by = 1$.

Using the method of Lagrange multipliers from multivariable calculus on this version of the problem yields quickly that the optimum has $(x^3,y^3)$ proportional to $(a,b)$.

Can someone explain how he first makes that rephrasal and then how he derives the constraints and makes that conclusion ?

P.S. The author is not on MathsSE anymore, hence I cannot ask him for clarification.

  • $\begingroup$ I've added a second half to complete my answer. $\endgroup$ Dec 31, 2015 at 16:47

2 Answers 2


It is quite obvious that the critical position for the ladder is the one where the ladder touches $(a,b)$ and the endpoints are at $(x,0)$ and $(0,y)$ (along the outer boundary of the corridors). The reason is the following: To move the ladder around the corner, you can for example keep a point of the ladder at $(a,b)$ then you move one of the endpoints along $(x,0)$. As long as the other endpoints is at a position $(x_2, y)$ with $x_2\leq 0$ the ladder "fits". The longest length of the ladder is thus the shortest distance between $(x,0)$ and $(0,y)$ while passing through $(a,b)$.

The length of the ladder is given by $(x^2+y^2)^{1/2}$. So we only need to determine the condition that the line passing through $(x,0)$ and $(0,y)$ also passes through $(a,b)$. We can write the expression $$ \frac{y_l}{y} + \frac{x_l}{x} =1 \tag{1}$$ for the points $(x_l,y_l)$ on the line segment of the critical position of the ladder. Demanding that $x_l=a$, $y_l=b$ fulfils (1) leads to the result quoted.


To do the conversion, $(x^2+y^2)^{1/2}$ is simply the length by Pythagoras.

The line which passes through $(x,0)$ and $(0,y)$ is $xy=Xy+xY$ (variables are $X$ and $Y$), and this also passes through $(a,b)$ iff $xy=ay+xb$ or $1=\frac ax+\frac by$, which is the constraint.

Then taking $$L=(x^2+y^2)^{1/2}+\lambda \left (\frac ax+\frac by-1\right)$$ and using $d=(x^2+y^2)^{1/2}$ for the length of the ladder, we want the partial derivatives of $L$ to be zero i.e. $$L_x=\frac xd-\frac {\lambda a}{x^2}=0$$and $$L_y=\frac yd-\frac {\lambda b}{y^2}=0$$ whence the solution has $$x^3=\lambda ad; y^3=\lambda bd$$ and dividing one by the other gives $$\frac {x^3}{y^3}=\frac ab$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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