Artificial intelligent assistant

Optimal ladder position to maximize height reached 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!)

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

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 927cb7e9287f013d9d30cc34ca5d38bb