
Optimization help #2
A fence 8 ft tall runs parallel to a tall building at a distance of 4 ft from the building. What is
the length of the shortest ladder that will reach from the ground over the fence to the wall of the
building?
I have set up the picture and understand the question  can someone just please explain how to solve the problem? (what the equation is, and the process for maximizing/minimizing stuff like this)
Thanks!

17.88 ft
i dont know how to optimise  but instead i used a cartesian plane and found that a gradient of 2 yielded the shortest distance for a line that passes through (4,8) which represents the top of the fence.
hope this type of thinking could help
im not sure if i am correct so please correct me if i am wrong