Let the dimensions of pen be a x b then as the perimiter is 40m we have:

2a+2b=40

or:

b=20-a,

so now the area of the pen is:

A=a(20-a)

and the maximum of a quadratic occurs midway between its roots, so the

maximum area occurs when a=10m, but then b=10 and the pen is a square of

area 100m^2.

RonL