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 ??$$

Hint:
Observe that
$$\frac{\partial f}{\partial x}=0=\frac{\partial f}{\partial y}\qquad\implies\qquad\cos x=\cos y\qquad\iff\qquad x=2n\pi\pm y\;\;\text{for some }n\in\mathbb{Z}$$
If $x=2n\pi+y$ we have
\begin{align*}
\frac{\partial f}{\partial x}=0&\quad\implies  &15\cos(2n\pi+2y)+7\cos(2n\pi+y)&=0\\
&\quad\iff&15\cos (2y)+7\cos y&=0\\
&\quad\iff&15\left(2\cos^2 y-1\right)+7\cos y&=0\\
&\quad\iff&30\cos^2 y+7\cos y-15&=0\\
&\quad\iff&\cos y&\in\left\{\frac35,-\frac56\right\}\\
\end{align*}
