Example 8. Find the integral $\int \frac{d x}{\sin x}$.
Solution. Let $\frac{x}{2}=t$, we get

$$
\begin{gathered}
\int \frac{d x}{\sin x}=\int \frac{d x}{2 \sin \frac{x}{2} \cos \frac{x}{2}}=\int \frac{d\left(\frac{x}{2}\right)}{\sin \frac{x}{2} \cos \frac{x}{2}}=\int \frac{d t}{\sin t \cos t}= \\
=\ln |\operatorname{tg} t|+C=\ln \left|\operatorname{tg} \frac{x}{2}\right|+C
\end{gathered}
$$