\documentstyle[12pt]{article}
\begin{document}
\section*{How to integrate rational trigonometric functions}

There is a general method to evaluate integrals of the form
$$\int^t R(\cos s,\sin s)\,ds,$$
where $R$ is some rational function. The method is based on the substitution
$u=\tan(s/2)$ and the identities
$$\sin s=2\sin(s/2)\cos(s/2)=2\tan(s/2)\cos^2(s/2)={2\tan(s/2)\over 
1+\tan^2(s/2)}={2u\over 1+u^2},$$
$$\cos s=2\cos^2(s/2)-1={2\over 1+u^2}-1={1-u^2\over 1+u^2},$$
$${du\over ds}={1\over 2\cos^2(s/2)}={1+u^2\over 2}.$$
The integral then becomes
$$\int^{\tan(t/2)} R({1-u^2\over 1+u^2},{2u\over 1+u^2}){2\over 1+u^2}\,du.$$
\\
Example:
$$\int^t {1\over\sin s}\,ds=\int^{\tan(t/2)} {1+u^2\over 2u}{2\over 1+u^2}\,du
=\int^{\tan(t/2)}{1\over u}\,du=\ln|\tan(t/2)|,$$
Note: You can use double angle formulas to show that
$$\csc(t)-\cos(t)=\tan(t/2).$$
\end{document}
