Well firstly if we have a rectangle, and have x metres as one side, we have 500-x as the other side (can you see where this comes from?). Thus the area is x(500-x) = 500x - x^2.
This next bit can be quite tricky.
Let f(x) = x^2. Let's say we increase f(x) by a small amount, call it h, so we get f(x+h) = (x+h)^2. Also by drawing a graph we can see that the gradient (call this f '(x)) is approximately (f(x+h)-f(x))/h, thisbeing the change in y over the change in x. Now expanding, we get f '(x) = (x^2 + 2xh + h^2 - x^2)/h = 2x + h.
Now if we let h become very small, so that it is essentialy 0, we can disregard the h, as it is negligable, as such the gradient of x^2 is 2x (such a process of taking h to be infinitely small is called taking a limit).
Right, now we can see that if f (x) = 500x - x^2, f '(x) = 500 - 2x.
Now for one more point, we note that if the gradient of a line is 0, then that point where the gradient is 0 must be a turning point of some form (either a maximum or a minimum or an inflexion {inflexion as in an x^3 graph at the origin). Also note that if the change in the gradient (call this f ''(x)) is less than 0, then after this point where the gradient is 0 (stick with me here) the gradient will then decrease and so our function will begin to decrease as such we see that this point where it turns is a maximum.
Ok, f ''(x) = -2. And if f '(x) = 0, then x = 250 which is a maximum. It now turns out the shape with maximal area is in fact a square with area 250^2.
Now you can look at other shapes such as circles and possibly even ellipses if you have met them.
Let me know if you don't understand anything.