Not my own homework problem, but somebody else's. Parallel to a tall building runs a 6ft high fence. It is 2ft away from the building. What is the shortest ladder needed to reach the building from the other side of the fence? I've drawn a diagram for this problem (see attached). I've called the height above the ground at which the ladder touches the building 'h' and the distance of the base of the ladder from the fence 'x' and the length of the ladder 'L'. Then L2 = h2 + (x + 2)2 I think that by expressing L as a function in terms of one of the variables, x or h, and differentiating with respect to that variable, I can find then find the minimum length of the ladder. By considering similar triangles 6/x = h/(2 + x) So x = 12/(h - 6) And h = 12/x + 6 But by substituting in either of these values, the differentiation dL/dx or dL/dh becomes horrible. Is there an easier way to solve this problem? Am I overlooking something? I'd like to see if I could find an easier function to differentiate.