9. Solve the equation $\sin x-\cos x-3 \sin 2 x+1=0$.

Solution: Let $t=\sin x-\cos x$. Since $t^{2}=(\sin x-\cos x)^{2}=$ $1-\sin 2 x$, we get the equation $t-3\left(1-t^{2}\right)+1=0$, or $3 t^{2}+t-2=0$. The roots of this equation are $t=-1 ; \frac{2}{3}$. Substituting the found values into the formula $\sin 2 x=1-t^{2}$, we get $\sin 2 x=0$ or $\sin 2 x=\frac{5}{9}$.

Answer: $\frac{\pi k}{2} ; \frac{(-1)^{k}}{2} \arcsin \frac{5}{9}+\frac{\pi k}{2}, k \in \mathbb{Z}$.
1.I.9. Comment. The following error is made in the given solution. The equation $\sin 2 x=t^{2}-1$ is not equivalent to the equation $\sin x-\cos x=t$, but is a consequence of it. Therefore, the answer contains numbers that are not solutions to the original equation.