8.252. $(\sin x-\cos x)^{2}+\tan x=2 \sin ^{2} x$.
## Solution.

Domain of definition: $\cos x \neq 0$.

Since $\operatorname{tg} \alpha=\frac{1-\cos 2 \alpha}{\sin 2 \alpha}$ and $\sin ^{2} \frac{\alpha}{2}=\frac{1-\cos \alpha}{2}$, we have $\sin ^{2} x-2 \sin x \cos x+\cos ^{2} x+\frac{1-\cos 2 x}{\sin 2 x}-(1-\cos 2 x)=0 \Leftrightarrow$ $\Leftrightarrow 1-\sin 2 x+\frac{1-\cos 2 x}{\sin 2 x}-1+\cos 2 x=0 \Leftrightarrow$ $\Leftrightarrow-\sin ^{2} 2 x+1-\cos 2 x+\sin 2 x \cos 2 x=0 \Leftrightarrow$.

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

From this, 1) $\cos 2 x=0$, 2) $\cos 2 x-1+\sin 2 x=0$.

From the first equation, we find

$$
2 x=\frac{\pi}{2}+\pi k, x_{1}=\frac{\pi}{4}+\frac{\pi k}{2}=\frac{\pi}{4}(2 k+1), k \in Z
$$

The second equation can be written as

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

We get $\sin x=0, x_{2}=\pi n, n \in Z ; x_{2}$ does not satisfy the equation;

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

Answer: $x=\frac{\pi}{4}(2 k+1), k \in Z$.