*Originally posted by XanthosNZ*

**Imagine you have 100 metres of fencing that can only be fenced in a straight line. Making a corner costs you 0.5m of fence in wastage and can only be abrupt (a sharp corner, not curved at all). What is the largest area you can enclose using a regular polygon? Can you show that this is the largest area possible using any shape?**

The area of a regular polygon is given by:

A = (n*(k/2)^2) / tan(theta/2)

where "n" is the number of sides, "k" is the edge length, and "theta" is the angle between two neighbouring lines drawn from the centre to the vertices of the polygon. In this case:

k = (100 - 0.5*n) / n (because of the wastage at each vertex)

tan(theta/2) = tan(2*pi/2*n) = tan(pi/n)

Taking the derivative of A with respect to n, setting A' = 0, and solving for n, we find that there is a local maximum at n = 8.747. Since a regular polygon has an integer number of sides, we check n = 8 and n = 9, and find that n = 9 gives the larger area. To check to see if this area is the maximum, note that the edge length is negative for n > 200, and that this function decreases for 9 < n < 200.