<s>[INST] 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.
 [/INST] 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$
</s>