The method to solve optimization question is :
1、Equate;
2、Find the stationary point;
3、Find the second derivative
A、if second derivative is positive,
the curve concaves up,
the staionary point is minimum point (minima).
B、if second derivative is negative,
the curve concaves down,
the staionary point is maximum point (maxima).
The detailed solution below is for your reference.