Question 254482
If there are no restrictions, we have the following equations:
(i) {{{P = 2L + 2W}}}
(ii) {{{A = LW}}}
solve (i) for L and we get
(iii) {{{L = (P-2W)/2}}}
substitute this in for (ii) to get
(iv) {{{A = ((P-2W)/2)*W}}} = {{{-1W^2 + PW/2}}}
the area is a parabola opening down, we can find the vertex using -b/2a as
-b/2a = -(p/2)/(-2) = p/4
and then put p/4 into the original equation to get
A = -(p/4)^2 + p(p/4)/2 = -p^2/16 + p^2/8 = p^2/16.
But this is the same thing as
{{{A = (p/4)^2}}} which is a square.
--
If there is a house on one side and fencing on the other three sides, we get:

v) {{{P = L + 2W}}}
(vi) {{{A = LW}}}
solve (i) for L and we get
(iii) {{{L = P-2W}}}
substitute this in for (ii) to get
(iv) A = (P-2W)*W = -2W^2 + PW
the area is a parabola opening down, we can find the vertex using -b/2a as
-b/2a = -(p)/(-4) = p/4
and then put p/4 into the (iv) to get
A = -2(p/4)^2 + p(p/4) = -p^2/8 + p^2/4 = p^2/8.
But this is the same thing as
{{{A = (1/2)*(p/2)^2}}}