8. The domain of the function $f(x)=\frac{\sin 2 x \cos x}{1-\sin x}$ is $\qquad$ , and the range is $\qquad$ .
8. $\left\{x \left\lvert\, x \neq 2 k \pi+\frac{\pi}{2}\right., k \in \mathbf{Z}\right\},\left[-\frac{1}{2}, 4\right)$.

From $1-\sin x \neq 0$, i.e., $x \neq 2 k \pi+\frac{\pi}{2}, k \in \mathbf{Z}$. And $f(x)=2 \sin x(1+\sin x), -1 \leqslant \sin x < 1$, so $-\frac{1}{2} \leqslant f(x) < 4$.