I have this optimization problem, with the solution, but I don't really understand how to do this. Can someone please explain it to me? I mean, I the solution, I got totally lost when he started working out the problem after that long paragraph. Where did he get the first equation from? One hallway (which is 4 feet wide) meets another hallway (which is 8 feet wide) in a right-angled corner. What is the length of the longest ladder which can be carried horizontally around the corner? Give an exact answer, assuming the ladder has no width.