This is a simple calculus problem but it can be solved without calculus, as follows:
let L=length of the pen and W = width
2(L + W) = 200 => L + W = 100 => L = 100 - W
Let A = area of the pen
A = L*W = 100W - W2
Sketch this parabola which has a positive maximum which occurs at W = 100/2
(Note the maximum of the parabola Ax2 + Bx + C occurs at x=-B/2A)
This means the area is maximum when W = 50, in other words the maximum area occurs when the rectangle is a square!