<s>[INST] Find maximum of $\sin{x}+\sin{y}-\sin{(x+y)}+\sqrt{3}\left(\cos{x}+\cos{y}+\cos{(x+y)}\right)$ The trick is that we can't use derivatives.
If we look at $\cos{x}+\cos{y}+\cos{(x+y)}$, the function cos attains its maximum of $1$ at $0$ radians, so $x=y=0$ and $x+y=0$ and the maximum of $\cos{x}+\cos{y}+\cos{(x+y)}=1+1+1=3$.
What about part of the function with $\sin$? If we use the same logic: $\sin$ attains its maximum of $1$ at $\pi/2$ radians, so $x=y=\pi/2$, so $x+y=\pi$, we get the maximum of $\sin{x}+\sin{y}-\sin{(x+y)}=1+1-0=2$, but I guess it's not true, cause Wolfram says the maximum is $0$.
Any hint would help a lot!! thank you!
 [/INST] $$
\sin{x}+\sin{y}-\sin{(x+y)}+\sqrt{3}[\cos{x}+\cos{y}+\cos{(x+y)}]
\\=\sin x+\sin y -\sin(x+y)+\tan \frac\pi3[\cos x+\cos y+\cos(x+y)]\\
=\frac1{\cos\dfrac\pi3}[\sin(x+\frac\pi3)+\sin(y+\frac\pi3)+\sin(\frac\pi3-x-y)]\\
=\frac1{\cos\dfrac\pi3}[\sin(x+\frac\pi3)+\sin(y+\frac\pi3)+\sin[ \pi-(\frac{\pi}3+x)-(\frac\pi3+y)]\\
$$
The expression in the square bracket is the sum of sines of 3 angles in a triangle. Its maximum is obtained when all are equal. This can be seen if we consider the sum of 2 angles in a triangle $\alpha,\beta,\gamma$. For 2 angles $\alpha,\beta$ and a fixed $\gamma$ the sum is: $\sin \alpha+\sin\beta=2\sin\dfrac{\alpha+\beta}2 \cos\dfrac{\alpha-\beta}2$. It is maximized when $\alpha=\beta$. Then the sum of each with a $\gamma$ will be maximized when they are equal as well and we conclude that all the 3 must be equal. It follows that:
$$
x+\dfrac\pi3=y+\dfrac\pi3= \pi-(\frac{\pi}3+x)+(\frac\pi3+y)
$$
and therefore $x=y=0$ and the maximum value of the expression is: $3\tan\dfrac\pi3=3\sqrt3$
</s>