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.
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.
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$$