$a,b\in \mathbb{R}$ and these numbers satisfy this egality:
$(\cos(a)+\cos(b))^{2}+(\sin(a)+\sin(b))^{2}=2\cos^{2}(\frac{a-b}{2})$
I need to find $a-b$ (The right answer is $a-b=2k\pi+\pi|k\in \mathbb{Z}$)
My try: I know that the expression $(\cos(a)+\cos(b))^{2}+(\sin(a)+\sin(b))^{2}=4\cos^{2}(\frac{a-b}{2})$
So I get $4\cos^{2}(\frac{a-b}{2})=2\cos^{2}(\frac{a-b}{2})$ and I get $\cos^{2}(\frac{a-b}{2})=0$ but my result is $+-\pi+4k\pi$
Where's my mistake?
Your mistake is only in your algebra at the end. We know $$\cos^2\left(\frac{a-b}{2}\right)=0\Longleftrightarrow \frac{a-b}{2}=(2k+1)\frac{\pi}{2},\quad k\in\Bbb Z.$$ Multiply both sides by $2$ to get $a-b=(2k+1)\pi$, which agrees with the answer.