\chapter[Techniques of Integration I]{Techniques of Integration I: Substitution, Powers of Trig Functions}

\section{Substitution}

By a {\bf \index{technique of integration: substitution} technique of integration} we mean a method which can be used to
find the antiderivative (indefinite integral) of certain types of
functions.  We first review $u$-substitutions.  We shall use an example to
illustrate the thought process that goes into deciding on a substitution of
the form $u=u(x)$.


\begin{example}
%{\bf Example 1.} 
Find the $x$-coordinate of the center of mass of the
uniform plate that is bounded by the $x$- and $y$-axes, the line $x=10$,
and the curve $y=1/(1+0.01x^2)$.

\smallskip

We must compute
$\overline{x}=\int_0^{10}x\,dx/(1+0.01x^2)\biggm/\int_0^{10}dx/
(1+0.01x^2)$.  At first the top and bottom integrals look similar: both
have $(1+0.01x^2)$ in the denominator.  However, they are actually quite
different.

\smallskip

In the bottom we have something very close to $\int
du/(1+u^2)=$Arctan$\,u+C$.  The only problem is the constant $0.01$ in
front of $x^2$.  So we choose $u$ so that $u^2=0.01x^2$, i.e., $u=0.1x$.
Then $x=10u$, $dx=10du$.  The limits of integration also change:
$x=0\Longrightarrow u=0$, and $x=10\Longrightarrow u=0.1\cdot 10=1$.
Hence, the bottom integral becomes
$\int_0^110\,du/(1+u^2)=10\,$Arctan$\,u\bigm|_0^1=10(\pi/4)=2.5\pi$.

\smallskip

The top integral, on the other hand, has nothing to do with Arctan.  The
$x$ next to the $dx$ changes everything.  Namely, $x$ is essentially the
derivative of the denominator.  Thus, a substitution $u=$denominator will
lead to something like $\int du/u=\ln|u|+C$.  More precisely, we set
$u=1+0.01x^2$, so that $du=0.02x\,dx$, and hence $x\,dx=50\,du$.  This
gives us $50\,du/u$ inside the integral.  The limits of integration change
as follows: $x=0\Longrightarrow u=1+0.01\cdot 0=1$, and $x=10
\Longrightarrow u=1+0.01\cdot 10^2=2$.  Thus, the top integral becomes
$50\int_1^2du/u=50\ln 2$.  Finally, we compute $\overline{x}=
50\ln2/2.5\pi=4.4127$.

\end{example}


\section[Odd powers]{Odd Powers of Sine and Cosine} 

The technique of $u$-substitution can be used to evaluate any integral of
the form
\[
\int\sin^n(ax+b)\,dx~~\text{ or }~~\int\cos^n(ax+b)\,dx
\text{,~where~ } n \text{ is~a~positive~odd~number}.
\]
The method works as follows.
Say we want to integrate $\sin^n$.  First take out one $~\sin~$ and put it
with the $dx$.  What remains will be $~\sin~$ to an {\it even} power.
Express this in terms of $\cos$ (using $\sin^2=1-\cos^2$).  Now make a
$u$-substitution for the $\cos$.  You will end up with only a polynomial to
integrate.  (If we had $\cos^n$ to integrate, we would do the same thing,
with the roles of $\sin$ and $\cos$ reversed.) We illustrate with an
example. \index{integration of odd powers of sin and cos}

\smallskip

\begin{example}
%{\bf Example 2.} 
Find $\int_0^1\sin^5(\pi x)dx$.

\smallskip

We first write $$\int_0^1\sin^5(\pi x)dx=\int_0^1\sin^4(\pi x)\sin(\pi
x)dx=
\int_0^1\bigl(1-\cos^2(\pi x)\bigr)^2\sin(\pi x)dx.$$
Next, we make the substitution $u=\cos(\pi x)$, so that $du=-\pi\sin(\pi
x)$.  Then $\sin(\pi x)dx=-\frac{1}{\pi}du$, and so our integral becomes
$-\frac{1}{\pi}\int\bigl(1-u^2\bigr)^2du$.  The limits of integration change
as follows: $x=0\Longrightarrow u=\cos 0=1$, and $x=1\Longrightarrow
u=\cos\pi=-1$.  To integrate the polynomial, we expand the square:
$(1-u^2)^2=1-2u^2+u^4$.  So we obtain:
$$-\frac{1}{\pi}\int_1^{-1}1-2u^2+u^4\,du=-\frac{1}{\pi}\left(u-\frac{2}{ 3}u^3
+\frac{1}{ 5}u^5\right)\Bigm|_1^{-1}=\frac{16}{ 15\pi}.$$

\end{example}

\smallskip

It is also possible to use this method to integrate {\it negative} odd
powers of sine and cosine.  However, in that case instead of a polynomial
in $u$ you end up with a {\it rational function} (i.e., you have a
denominator with a polynomial in it).  We will treat some cases of this in
part III of techniques of integration.


\section[Even powers]{Even Powers of Sine and Cosine} 
\index{integration of even powers of sin and cos}
The above technique does not work if you want to integrate something like
$\cos^2$ or $\sin^4$.  To handle even powers one needs a trig identity,
namely, the $\cos(2A)$ formula: $\cos(2A)=\cos^2A-\sin^2A$.  When combined
with the trig identity $1=\cos^2A+\sin^2A$, this gives formulas for either
$\cos^2A$ or $\sin^2A$ in terms of $\cos(2A)$.  If we add these two
identities and divide by 2, we get $\cos^2A$; if we subtract them and
divide by 2, we get $\sin^2A$:
\begin{alignat*}{2} 
\cos^2A+\sin^2A &=1  
&
\cos^2A+\sin^2A&=1
\\
+~~~\underline{\cos^2A-\sin^2A} &=\underline{\cos(2A)} 
&
-~~~\underline{\cos^2A-\sin^2A} &=\underline{\cos(2A)}  \\ 
2\cos^2A&=1+\cos(2A)
&
2\sin^2A&=1-\cos(2A) \,, \\
\intertext{i.e.,}
\cos^2A&=\frac{1+\cos(2A)}{ 2},
&
\sin^2A&=\frac{1-\cos(2A)}{ 2}.
\end{alignat*}
We now illustrate the use of these two identities in integration
problems.


\begin{example}
%{\bf Example 3.} 
Find the average value of $\sin^2x$ between 0 and $\pi$.

\smallskip

The \index{average value of a function} average value of a function $f(x)$ on the interval $[a,b]$ is the
integral of the function divided by the length of the interval: $\frac{1}{
b-a}\int_a^bf(x)dx$.  So the average value of $\sin^2x$ is
\begin{align*}
\frac{1}{\pi}\int_0^\pi\sin^2x\,dx 
&=\frac{1}{\pi}\int_0^\pi\left(\frac{1- \cos(2x)}{ 2}\right)\,dx\\
&=\frac{1}{\pi}\left(\frac{1}{ 2}x-\frac{1}{ 2}\cdot
\frac{1}{ 2}\sin(2x)\right)\Bigm|_0^\pi\\
&=\frac{1}{\pi}\left(\frac{\pi}{ 2}-\frac{1}{ 4}(0-0)\right)=\frac{1}{ 2}.
\end{align*}

\end{example}

\begin{example}
%{\bf Example 4.} 
Find the antiderivative of $\cos^4x$.

\smallskip

We have 
\begin{align*}
\int\cos^4x\,dx&=\int\left(\cos^2x\right)^2\,dx
= \int\left(\frac{1+\cos(2x)}{ 2}\right)^2\,dx \\
&=\int\left(\frac{1+2\cos(2x)+\cos^2(2x)}{ 4}\right)\,dx.
\end{align*} 
We now use the identity for $\cos^2(A)$ once more, this time with $A=2x$:
$\cos^2(2x)=(1+\cos(4x))/2$.  In this way we end up replacing all powers of
cosine with expressions of the form $\cos(ax)$, which are easy to
integrate.  After writing 
\begin{align*}
1+2\cos(2x)+\cos^2(2x)&=1+2\cos(2x)+ (1+\cos(4x))/2 \\
                      &=\frac{3}{ 2}+2\cos(2x)+\frac{1}{ 2}\cos(4x)
\end{align*}
and dividing this by 4, we obtain
\begin{align*}
\int\cos^4x\,dx
&=\int\left(\frac{3}{ 8}+\frac{1}{ 2}\cos(2x)+\frac{1}{ 8}\cos(4x)\right)\,dx\\
&=\frac{3}{ 8}x+\frac{1}{ 4}\sin(2x)+\frac{1}{ 32}\sin(4x)+C.
\end{align*}

\end{example}
% 
