Calculus - optimization problem without much given info

An 8m high fence stands 3 metres from a large vertical wall.

Find the length of the shortest ladder that will reach OVER the fence to touch the wall behind it.

My approach was to come up with an expression for the length of the ladder, and then optimise using differentiation. I managed to do this, but it ended up being ridiculously complex, and even my calculator couldn't handle it.

• You should add some of you attempt into the question, then people can see what you have tried, and where you may have gone wrong. – okrzysik Nov 17 '15 at 9:41
• Or maybe it's just a very complex problem. – Gerry Myerson Nov 17 '15 at 9:44
• Let $x$ be distance from ladder base to the fence, then expression for square of ladder length (which is minimal when length itself is minimal) will be relatively simple. – Abstraction Nov 17 '15 at 9:46