Start by drawing a diagram. If you have the first post be the 8ft post and the second be 12ft, then you can call the position of the stake from the 8ft post .

You should notice that once you have drawn the diagram with the posts and the wires, you should end up with 2 right angle triangles.

The first triangle has base and height , so the wire will be .

The second triangle has base and height , so the wire will be .

So you are minimising .

You will need to simplify this, then take the derivative to find the critical points.