<s>[INST] Find $x$ and $y$ such that $15\sin(x+y)+7\sin x+7\sin y$ is maximized Question is: Find $x$ and $y$ such that
$$15\sin(x+y)+7\sin x+7\sin y$$
is maximized.
What I tried was
$$f(x,y)=15\sin(x+y)+7\sin x+7\sin y=15(\sin x\cos y+\cos x\sin y)+7(\sin x +\sin y)$$
$$\frac{\partial f}{\partial x}=15\cos(x+y)+7\cos x=0$$
$$\frac{\partial f}{\partial y}=15\cos(x+y)+7\cos y=0$$
$$\cos x=\cos y$$
$$y=-x$$
$$\cos x=-{15\over 7}\quad ??$$
 [/INST] Since $f$ is periodic, we don't need to consider the other regions.
Hence, we can consider $x = \pm y$ without the $2n\pi$.

For the case $x=y$, we obtain:
$$\begin{array}{rcrcl}
\dfrac{\partial f}{\partial x} &=& 15\cos(x+y)+7\cos x &=& 0 \\
&& 15\cos(2x)+7\cos x &=& 0 \\
&& 15(2\cos^2x-1)+7\cos x &=& 0 \\
&& 30\cos^2x + 7\cos x - 15 &=& 0 \\
&& (6\cos x+5)(5\cos x - 3) &=& 0 \\
\end{array}$$
Hence, $\cos x=-\dfrac56$ or $\dfrac35$.
$$\begin{array}{rcl}
15\sin(x+y)+7\sin x+7\sin y
&=& 15\sin2x+14\sin x \\
&=& 30\sin x \cos x + 14\sin x \\
\end{array}$$
From this, we can obtain $4$ values.

For the case $x=-y$, we obtain $\cos x = -\dfrac{15}7$.
From this, we can obtain $2$ values.

Using the second partial derivative test:
$$H(x,y) = \begin{pmatrix}f_{xx}(x,y) &f_{xy}(x,y)\\f_{yx}(x,y) &f_{yy}(x,y)\end{pmatrix} = \begin{pmatrix}-15\sin(x+y)-7\sin x & -15\sin(x+y)\\-15\sin(x+y) & -15\sin(x+y)-7\sin y\end{pmatrix}$$
Then,
$$D(x,y) = \det(H(x,y)) = 105\sin(x+y)(\sin x + \sin y) + 7 \sin x \sin y$$
Find values from the $6$ values found, such that $D < 0$ and $f_{xx} < 0$.
For the case $x=-y$, $D$ must be negative, so they can be rejected.
</s>