Problem on finding the maxima of a function I need to find the maximum value of $f(x) = (2\sin A + 3\cos A + 4)^2 * (6-2\sin A-3\cos A)^3$ as $A$ ranges over all real numbers. 
For this I performed the derivative tests by plugging in $2\sin A + 3\cos A = t$, which yielded me the value of $A = \tan^{-1}[-2/3]$. 
Here's where I am stuck. As A lies in the second or fourth quadrant, I am not sure as to what signs I should pick for $\sin A$ and $\cos A$. Calculation gave me the maximum value to be $3456$ at $\sin A = \sqrt{9/13}$
and $\cos A = \sqrt{4/13}$, after taking the positive value of sinA and the negative value of cosA... but why?
Please help me out with this problem. Thanks in advance.
 A: For the ease of calculation, let $t=6-(2\sin A+3\cos A)$
$$\implies6-\sqrt{2^2+3^2}\le t<6+\sqrt{2^2+3^2}$$
$$g(t)=(10-t)^2\cdot t^3$$
Using AM-GM inequality for $(10-t,t>0\iff0<t<10$
$$\dfrac{10}5=\dfrac{2\cdot\dfrac{10-t}2+3\cdot\dfrac t3}{2+3}\ge\sqrt[2+3]{\left(\dfrac{10-t}2\right)^2\left(\dfrac t3\right)^3}$$
the maximum of the RHs will be attained if $$\dfrac{10-t}2=\dfrac t3\iff30-3t=2t\iff t=6$$
$$\iff2\sin A+3\cos A=0$$
$$\iff\dfrac{\sin A}3=\dfrac{\cos A}{-2}=\pm\sqrt{\dfrac{\sin^2A+\cos^2A}{(3)^2+(-2)^2}}$$
So, we need $\sin A=\dfrac{3b}{\sqrt{13}},\cos  A=\dfrac{-2b}{\sqrt{13}}$ where $b=\pm1$
So,  we only need opposite signs of $\sin A,\cos A$
A: Using the same symbols as yours, let $g(t)=(t+4)^2(6-t)^3$  differentiating both sides gives: 
$g'(t)=(t+4)(6-t)^2(-5t)$ 
Note that $(t+4)\gt 0, 6-t\ne0$ for all allowed $t$. 
It follows that $g$ is increasing for $t\lt 0$ and decreasing for $t\gt 0$ and therefore $g$ attains maxima at $t=0$ which is therefore a point of local maxima. We also note that $g(0)=4^26^3$. Of course it is attained when $A$ satisfies $2\sin A+3\cos A=0$ and it's not required for what value of $A$. 
We are almost done! It remains to show that $0$ is actually a point of absolute maximum. For that, we note that given function is periodic with period $2\pi$ and it suffices to analyse the given function only on $[0,2\pi]$. At end points, that is for $A=0$ and $A=2\pi$ we have $f(0)=f(2\pi)=7^23^3=1323\lt 4^26^3$ and this shows that $4^26^3$ is the maximum value of $f(A)$ which is attained when $\tan A=-\frac 32$ that is when $A=\arctan(-\frac 32)+\pi$ or $\arctan (-\frac 32)+2\pi$ for $A\in [0,2\pi]$.
