<s>[INST] The length of the smallest possible ladder to change the bulb. 
In the drawing, the point P, a bit located under the bulb, has coordinates (a, b​​), where a and b are two parameters. You want to change the bulb, and for this it is necessary to install a ladder such that 


*

*It relies on the ground (the $Ox$) axis at the point $S$.

*It rests against the vertical wall (the $Oy$ axis) at the point $M$.

*She passes exactly through the point $P$.



Question : What, in function of $a$ and $b$ only, the length of the smallest possible ladder fulfilling the three conditions above?

My try: 
I tried to compute the coordinate of $M(0,y_M)$ in function of $a,b$ but I am stuck with some ugly calculs.
I wrote $\Vert\overrightarrow{MS}\Vert=\Vert\overrightarrow{MP}\Vert+\Vert\overrightarrow{PS}\Vert$ and square it. It looks like 
$$
2by_M=a^2-b^2+b^2+(c-a)^2+2\sqrt{a^2(c-a)^2+(ab)^2+b^2(b-y_M)^2+(b-y_M)^2(c-a)^2}
$$
As usual, I think I miss something. 
 [/INST] Let $x$ be the base of the triangle and let $y$ be the height.
To minimize the length $L$ of the ladder, we can minimize $L^2=x^2+y^2$.
By similar triangles, $\displaystyle\frac{y}{x}=\frac{b}{x-a}$, so $\displaystyle y=\frac{bx}{x-a}$ and $\displaystyle f(x)=L^2=x^2+\frac{b^2x^2}{(x-a)^2}$.
Then $f^{\prime}(x)=2x+\frac{(x-a)^2(2b^{2}x)-b^{2}x^2(2(x-a))}{(x-a)^4}=2x-\frac{2ab^{2}x}{(x-a)^3}=0$ if $2x(x-a)^3=2ab^{2}x$,
so $(x-a)^3=ab^2$ since $x\ne0$.  Therefore $x=a+a^{1/3}b^{2/3}=a^{1/3}(a^{2/3}+b^{2/3})$ and
$\displaystyle \;\;\;\;y=\frac{bx}{x-a}=\frac{ba^{1/3}(a^{2/3}+b^{2/3})}{a^{1/3}b^{2/3}}=b^{1/3}(a^{2/3}+b^{2/3}).$ 
Now find $L=\sqrt{x^2+y^2}$.
</s>