The Weirstrass substitution, also called the tangent half-angle substitution, is a method for converting integrals of trigonometric functions of x to regular rational functions of t. We do this by making a substitution of t = \tan(x/2). In general
\int f(\sin x, \cos x) \, dx = \int f\left(\frac{2t}{1 + t^2},\frac{1-t^2}{1+t^2}\right)\frac{2}{1 + t^2} \, dt.
Substitution
The substitution will be presented without proof, and functions as follows
Using the substitution t = \tan(x/2) the following functions of x can be expressed as ration functions of t
\sin x = \frac{2t}{1 + t^2}
\cos x = \frac{1 - t^2}{1 + t^2}
dx = \frac{2}{1 + t^2} dt
Note that the denominator in every case is 1 + t^2.
Given the following integral
\int \csc x \, dx
We use the Weirstrass substitution to obtain
\sin x = \frac{2t}{1 + t^2} \qquad dx = \frac{2}{1 + t^2}dt
and substitute it into our integral
\int \csc x \, dx = \int \frac{1 + t^2}{2t} \frac{2}{1 + t^2} \, dt
which becomes
\int \csc x \, dx = \int \frac{1}{t} \, dt = \ln(t)
yielding
\int \csc x \, dx = \ln(\tan\frac{x}{2})