Writing answers to trigonometric equation I wonder how to write answers to trigonometric equations in more elegant form. For instance if we have $ \displaystyle \sin x = \frac{\sqrt{2}}{2} \vee \sin x=-\frac{\sqrt{2}}{2}$ then I write four cases instead of just one where $\displaystyle x=\frac{\pi}{4}+\frac{k\pi}{2}$
Can anyone explain how to obtain such forms ? 

$$\sin x=-\frac{\sqrt2}2=-\frac1{\sqrt2}=\sin\left(-\frac\pi4\right)$$
$$\implies x=n\pi+(-1)^n\left(-\frac\pi4\right)$$ where $n$ is any integer
for $\displaystyle n=2m\implies x=2m\pi-\frac\pi4$
for $\displaystyle n=2m+1\implies x=(2m+1)\pi+\frac\pi4=2m\pi+\frac{5\pi}4$
Similarly, $\displaystyle\sin x=\frac{\sqrt2}2\implies $
for $\displaystyle n=2m\implies x=2m\pi+\frac\pi4$
for $\displaystyle n=2m+1\implies x=(2m+1)\pi-\frac\pi4=2m\pi+\frac{3\pi}4$
Observe that the values can be merged into $$n\cdot\frac\pi2+\frac\pi4$$ i.e., each of the four Quadrant has the offset $\dfrac\pi4$ 
