<s>[INST] Solving $\sin \frac{\theta}{2} + \cos \frac{\theta}{2} = \sqrt{2}$ Does anyone have some tips for me how to go about the problem in the image? 
$$\sin \frac{\theta}{2} + \cos \frac{\theta}{2} = \sqrt{2}$$
I know it's supposed to be simple, but I can't figure out why the solution is: 
$90^{\circ}+ 720^{\circ}k$ where $k=1,2,3,...$  
Intuitively, I understand the answer, but that's not the point, I would like to understand the correct mathematical solution. Thank you very much!
 [/INST] Firstly, denote $x=\frac{\theta}{2}$. Let $t=\tan \frac{x}{2}$. The equation $\sin x + \cos x = \sqrt 2$ became $$\frac{2t}{1+t^2} + \frac{1-t^2}{1+t^2}=\sqrt 2.$$
Therefore $2t + 1 -t^2 = \sqrt 2(1+t^2) \Rightarrow (\sqrt 2+1)t^2 -2t + \sqrt 2 - 1 = 0$. This equation has the solutions $t_1=t_2=\sqrt 2 - 1$. So
$$\frac{x}{2}\in \{\arctan(\sqrt 2-1)+k\pi\;|\;k\in\mathbb Z\}.$$
Thus, since $\theta = 4x$, we get
$$\theta \in \{4\arctan(\sqrt 2 - 1)+4k\pi\;|\;k\in\mathbb Z\}.$$
We have $$\tan(2\arctan(\sqrt 2-1))=\frac{2(\sqrt 2-1)}{(\sqrt 2-1)^2-1}=1,$$
hence $2\arctan(\sqrt 2-1)=\frac{\pi}{4} \Rightarrow 4\arctan(\sqrt 2-1)=\frac{\pi}{2}$. In conclusion,
$$\theta \in \{\frac{\pi}{2}+4k\pi\;|\;k\in\mathbb Z\}.$$
</s>