my lecturer recently showed us that when finding a maximum or minimum value of a rectangle, if the equation is too tedious to differentiate normally, we can instead take the square of the equation instead to differentiate.
The Equation was this,
Let r be a constant, $$ A=4x\sqrt{r^2-x^2} $$ He then said this would be too time consuming to differentiate normally in an exam and squared the whole function before differentiating. $$ A^2=16x^2(r^2-x^2) $$ $$ W=A^2 $$ $$ f'(W)=32r^2-64x^3 $$
He did not explain why you could do this but I am curious about why in this case it is alright to do this?
This works because for $A$ greater than or equal to $0$, $A^2$ is a monotonically increasing function of $A$. If you find parameters that maximize/minimize $A^2$, they will also maximize/minimize $A$.
You could in theory apply any monotonic transformation like multiplication, a logarithm, or exponentiation, the square just happens to make the derivative more convenient.