8.117. $1+\sin 2x=\sin x+\cos x$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.

8.117. $1+\sin 2x=\sin x+\cos x$.
## Solution.

Let's rewrite the equation as

$\sin ^{2} x+2 \sin x \cos x+\cos ^{2} x-(\sin x+\cos x)=0, \quad(\sin x+\cos x)^{2}-$ $-(\sin x+\cos x)=0, \quad(\sin x+\cos x)(\sin x+\cos x-1)=0$.

From this, either $\sin x+\cos x=0$, or $\sin x+\cos x-1=0$. From the first equation, $\operatorname{tg} x=-1, x_{1}=-\frac{\pi}{4}+\pi k=\frac{\pi}{4}(4 k-1), k \in Z$. The second equation can be written as

$$
\begin{aligned}
& 2 \sin \frac{x}{2} \cos \frac{x}{2}+\cos ^{2} \frac{x}{2}-\sin ^{2} \frac{x}{2}-\left(\cos ^{2} \frac{x}{2}+\sin ^{2} \frac{x}{2}\right)=0,2 \sin \frac{x}{2} \cos \frac{x}{2}- \\
& -2 \sin ^{2} \frac{x}{2}=0,2 \sin \frac{x}{2}\left(\cos \frac{x}{2}-\sin \frac{x}{2}\right)=0
\end{aligned}
$$

## From this

$$
\sin \frac{x}{2}=0, \frac{x}{2}=\pi n, x_{2}=2 \pi n, \quad n \in Z
$$

or

$\cos \frac{x}{2}-\sin \frac{x}{2}=0 \Leftrightarrow \operatorname{tg} \frac{x}{2}=1, \frac{x}{2}=\frac{\pi}{4}+\pi l, x_{3}=\frac{\pi}{2}+2 \pi l=\frac{\pi}{2}(4 l+1), l \in Z$.

Answer: $\quad x_{1}=\frac{\pi}{4}(4 k-1) x_{2}=2 \pi n ; x_{3}=\frac{\pi}{2}(4 l+1), k, n, l \in Z$.