Answer:
15.53 feet
Explanation:
You want to know the length of the shortest ladder that will reach from the ground over a 6 ft fence to the wall of the building 5 ft beyond.
Partial lengths
For some angle α the ladder makes with the ground, the distance from the ground to the top of the fence can be found from the fence height h as ...
ground to fence = h/sin(α) = h·csc(α)
The distance from the top of the fence to the building can be found from the horizontal distance d as ...
fence to building = d/cos(α) = d·sec(α)
Minimum
The minimum of the total length can be found to be the angle at which the derivative of length with respect to α is zero.
L = h·csc(α) +d·sec(α)
dL/dα = -h·csc(α)cot(α) +d·sec(α)tan(α) = 0
Dividing this by d·csc(α)cot(α) gives ...
tan(α)³ -h/d = 0
The angle that minimizes the length of the ladder is ...
α = arctan(∛(h/d))
α = arctan(∛(6/5)) ≈ 46.74°
Ladder length
The attached calculator screen computes the total ladder length as the sum of the lengths to the fence and beyond.
The minimum length ladder is 15.53 feet.
__
Additional comment
The third attachment shows that a graphing calculator can easily find the minimum length from the above description of it in terms of angle. The graph uses angle in degrees and length in feet.
A Pythagorean theorem solution method can also be used. It generally works well to define x as the distance from the fence to the ladder base, then write the length as the sum of the hypotenuses of similar triangles with a size ratio of d/x. Minimizing the ladder length expression also involves a cubic. The solution is x = ∛(dh²), where L = (1+d/x)√(h²+x²)