You need a function that determines the length of the wire for any given point at which the wires are staked between 0 and 24 meters. The assumption is that this point is on the line connecting the bases of the two poles. If you draw a sketch you will see that the two separate lengths of wire (from pole 1 to the ground and from pole 2 to the ground) can be calculated by the Pythagorean Theorem. Adding those lengths together will give you the length of the wire. That is your function.
Find the derivative of that function, set it equal to zero, and solve for x (critical numbers) (x must be between 0 and 24). The assumption that the 2nd derivative is > 0, allows you to conclude that the critical number produces a minimum L (as opposed to a max), i.e. the graph of the function is concave upward.
See the following to give you some ideas. Solving for the critical numbers gets pretty messy (big numbers and quadratic formula).
The above graph allows you to slide the "stake" point to various positions between 0 and 24 and shows you the value of L for the different positions of that point.