Solving a trigonometric equation, can someone check please? We are asked to solve the equation $$-\sin x + 1 = \cos x + 2$$ where $x \in [0,\frac{3\pi}{2}]$
What I did was this:
\begin{align*}
   \sin x + \cos x &=-1 \\
   1 + \sin2x &= 1 \\
   \sin 2x &=0 \\
   2x &\in \{0, \pi, 2\pi\} \\
   x &\in \left\{0,\frac{\pi}{2}, \pi\right\}
\end{align*}
Now, by checking, we can see that only $\frac{\pi}{2}$ is the solution. But is it correct to square the equation?

Edit: I just realized that $\frac{\pi}{2}$ is not a solution and $\pi$ and $\frac{3\pi}{2}$ should are. I am sorry that I didn't include $\frac{3\pi}{2}$, this is because in the actual context that I am working with, I already know that it is a solution.
 A: The squaring method is correct however note that if you square the expression you get more solutions and then you have to check all those to see which one of those solution fits. Let me give you an example to clarify this-
$$ x=2 $$
Squaring both sides
$$ x^2=4 $$
Thus we got $x=2$ and $x=-2$
However putting $x$ as $-2$ doesn't satisfy the original expression. Thus the only solution is $x=2$. Same is with your solution in question
A big edit: You have missed the solution $3\pi/2 $ which turn out to be the solution of the equation.
A: The method is correct. The problem is that the equation $(\sin(x)+\cos(x))^2=(-1)^2$ has more solutions that $\sin(x)+\cos(x)=-1$, and therefore you have to test each of them in order to see whether or not it is a solution of the original equation. And you missed $\frac{3\pi}2$, which is another solution of the original equation.
A: It is not incorrect to square the equation, but it is discouraged as there is a high chance that you get extraneous roots, which you would have to weed out. For this particular question, the best approach i can think of would be to divide both sides by $\sqrt 2$ to get:
$$\sin(x+\frac {\pi}{4})=\sin(-\frac {\pi}{4})$$
Then use the fact that if $\sin \theta =\sin \phi$, where $-\frac {\pi}{2}\leq \phi \leq \frac {\pi}{2}$, then $\theta =n\pi+(-1)^n \phi$
A: Squaring $\sin x+\cos x=-1$ gives you the roots to $\sin x+\cos x=\pm1$, which is fine as long as you then double check the possible roots against the original equation, in this case giving you $x=\pi,\frac{3\pi}{2}$, with $x=0,\frac{\pi}{2}$ giving the roots for $\sin x+\cos x=1$.
