Dear forum members,

A problem asks me to show that a rectangle of constant area A has a minimal perimeter when the rectangle is a square.

I make the equation for the area and differentiate it with respect to x.

Solving for the zero points

At this stage, am I allowed to substitute A=xh into the equation and solve it as

x=0 or x=h

or should I solve it as

or

because evidently the answer is different .

Please help me, I am really confused.

Thank you in advance.