8.179. $\sin ^{2} x+2 \sin ^{2} \frac{x}{2}-2 \sin x \sin ^{2} \frac{x}{2}+\operatorname{ctg} x=0$.
## Solution.

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

$$
\begin{aligned}
& \text { Using the formula } \sin ^{2} \frac{\alpha}{2}=\frac{1-\cos \alpha}{2} \text {, we write } \\
& \sin ^{2} x+1-\cos x-\sin x(1-\cos x)+\frac{\cos x}{\sin x}=0 \Leftrightarrow \\
& \Leftrightarrow \sin ^{2} x+1-\cos x-\sin x+\sin x \cos x+\frac{\cos x}{\sin x}=0 \Leftrightarrow \\
& \Leftrightarrow \sin ^{3} x+\sin x-\sin x \cos x-\sin ^{2} x+\sin ^{2} x \cos x+\cos x=0 \Leftrightarrow \\
& \Leftrightarrow\left(\sin ^{3} x+\sin ^{2} x \cos x\right)+(\sin x+\cos x)-\left(\sin x \cos x+\sin ^{2} x\right)=0 \Leftrightarrow \\
& \Leftrightarrow \sin ^{2} x(\sin x+\cos x)+(\sin x+\cos x)-\sin x(\sin x+\cos x)=0 \Leftrightarrow \\
& \Leftrightarrow(\sin x+\cos x)\left(\sin ^{2} x-\sin x+1\right)=0 \Leftrightarrow \sin x+\cos x=0 \Leftrightarrow \operatorname{ctg} x=-1, \\
& x=-\frac{\pi}{4}+\pi k=\frac{\pi}{4}(4 k-1), k \in Z ; \sin ^{2} x-\sin x+1 \neq 0 \quad(D<0) .
\end{aligned}
$$

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