I know that the solutions to the equation $\sin(x) = \cos(x)$ are :
$ x= \frac{\pi}{4}$ (45°) ; $ x= \frac{5 \pi}{4}$ (225°)
However when I try to solve it algebraically I get the following :
$$ \sin x = \cos x$$ $$ \sin^2 x = \cos^2 x$$ $$ \sin^2 = 1 - \sin^2 x$$ $$ 2\sin^2 x = 1$$ $$ sin^2 x = \frac{1}{2}$$ $$ \sqrt {sin^2 x} = \sqrt{\frac{1}{2}}$$ $$ \sqrt {sin^2 x} = \sqrt{\frac{1}{2}}$$ $$ \sin x= \lvert\frac{1}{\sqrt2}\rvert$$ $$ \sin x= \frac{\sqrt2}{2} ; \sin x= -\frac{\sqrt2}{2}$$
So if I look for all the values of $x$ that solve the above I should get not only $ x= \frac{\pi}{4}$ (45°) ; $ x= \frac{5 \pi}{4}$ (225°) but also $ x= \frac{3\pi}{4}$ (135°) ; $ x= \frac{7 \pi}{4}$ (315°).
What am I doing wrong?