Johann Heinrich Ludolf Steinike (1825-1909) was a German landscape painter.
We have sections
- Integration by Parts
- Trigonometric Substitutions
- Partial Fractions
- Rationalizing Substitutions
- Numerical Integration
\begin{equation}{\label{a}}\tag{A}\mbox{}\end{equation}
Integration by Parts.
We begin with the formula for the derivative of a product
\[(fg)'(x)=f(x)g'(x)+f'(x)g(x).\]
Integrating both sides, we get
\[\int (fg)'(x)dx=\int f(x)g'(x)dx+\int f'(x)g(x)dx.\]
Therefore, we obtain
\[\int f(x)g'(x)dx=f(x)g(x)-\int f'(x)g(x)dx.\]
This formula, called the formula for integration by parts. In practice, we usually set \(u=f(x)\) and \(dv=g'(x)dx\). Then, we have \(du=f'(x)dx\) and \(v=g(x)\). Now, the formula for integration by parts can be written as
\[\int udv=uv-\int vdu.\]
\begin{equation}{\label{e7}}\tag{1}\mbox{}\end{equation}
Example \ref{e7}. Calculate
\[\int xe^{x}dx\]
Let \(u=x\) and \(dv=e^{x}dx\). Then \(du=dx\) and \(v=e^{x}\).Therefore, we obtain
\begin{align*} \int xe^{x}dx & =\int udv=uv-\int vdu\\ & =xe^{x}-\int e^{x}dx\\ & =xe^{x}-e^{x}+C.\end{align*}
Example. Calculate
\[\int x\sin 2xdx.\]
Let \(u=x\) and \(dv=\sin 2xdx\). Then \(du=dx\) and \(v=-\frac{1}{2}\cos 2x\). Therefore, we obtain
\begin{align*} \int x\sin 2xdx & =-\frac{1}{2}x\cos 2x-\int -\frac{1}{2}\cos 2xdx\\ & =-\frac{1}{2}x\cos 2x+\frac{1}{4}\sin 2x +C.\end{align*}
Example. Calculate
\[\int x\ln xdx.\]
Let \(u=\ln x\) and \(dv=xdx\). Then \(du=\frac{1}{x}dx\) and \(v=\frac{x^{2}}{2}\). Therefore, we obtain
\begin{align*} \int x\ln xdx & =\frac{x^{2}}{2}\ln x-\int\frac{1}{x}\frac{x^{2}}{2}dx\\ & =\frac{1}{2}x^{2}\ln x-\frac{1}{4}x^{2}+C.\end{align*}
Example. Calculate
\[\int x^{5}e^{x^{3}}dx.\]
Let \(u=x^{3}\) and \(dv=x^{2}e^{x^{3}}dx\). Then \(du=3x^{2}\) and \(v=\frac{1}{3}e^{x^{3}}\). Therefore, we have
\begin{align*} \int x^{5}e^{x^{3}}dx & =\frac{1}{3}x^{3}e^{x^{3}}-\int x^{2}e^{x^{3}}dx\\ & =
\frac{1}{3}x^{3}e^{x^{3}}-\frac{1}{3}e^{x^{3}}+C.\end{align*}
Integration by parts can also be used in connection with definite integrals. Suppose that \(f'(x)\) and \(g'(x)\) are continuous on the interval \([a,b]\). Then, we have
\[\int_{a}^{b} f(x)g'(x)dx=\left [f(x)g(x)\right ]_{a}^{b}-\int_{a}^{b}f'(x)g(x)dx.\]
Example. Evaluate
\[\int_{1}^{2} x^{3}\ln xdx.\]
Let \(u=\ln x\) and \(dv=x^{3}dx\). Then \(du=\frac{1}{x}dx\) and \(v=\frac{1}{4}x^{4}\). Therefore, we obtain
\begin{align*} \int_{1}^{2} x^{3}\ln xdx & =\left [\frac{1}{4}x^{4}\ln x\right ]_{1}^{2}-\frac{1}{2}\int_{1}^{2} x^{3}dx\\ & =4\ln 2-\frac{1}{16}[x^{4}]_{1}^{2}\\ & =4\ln 2-\frac{15}{16}.\end{align*}
Example. Evaluate
\[\int_{0}^{1} x^{2}e^{x}dx.\]
Let \(u=x^{2}\) and \(dv=e^{x}dx\). Then \(du=2xdx\) and \(v=e^{x}\). Therefore, we obtain
\[\int x^{2}e^{x}dx=x^{2}e^{x}-\int 2xe^{x}dx.\]
We now compute the integral \(\int xe^{x}dx\) by parts again, which is in the above Example \ref{e7}. Therefore, we get
\begin{align*} \int_{0}^{1} x^{2}e^{x}dx & =\left [x^{2}e^{x}-2xe^{x}+2e^{x}\right ]_{0}^{1}\\ & =e-2.\end{align*}
Example. Find
\[\int e^{x}\cos xdx.\]
Let \(u=e^{x}\) and \(dv=\cos xdx\). Then \(du=e^{x}dx\) and \(v=\sin x\). Therefore, we obtain
\[\int e^{x}\cos xdx=e^{x}\sin x-\int e^{x}\sin xdx.\]
Now, we work with the integral
\[\int e^{x}\sin x.\]
Let \(u=e^{x}\) and \(dv=\sin xdx\). Then \(du=e^{x}dx\) and \(v=-\cos x\). Therefore, we obtain
\[\int e^{x}\sin xdx=-e^{x}\sin x+\int e^{x}\cos xdx,\]
which implies
\[\int e^{x}\cos xdx=e^{x}\sin x+e^{x}\cos x-\int e^{x}\cos xdx.\]
Finally, we obtain
\[\int e^{x}\cos xdx=\frac{1}{2}e^{x}(\sin x+\cos x)+C.\]
Example. Calculate
\[\int \sin^{-1}xdx.\]
Let \(u=\sin^{-1}x\) and \(dv=dx\). Then \(du=dx/\sqrt{1-x^{2}}\) and \(v=x\). Therefore, we obtain
\[\int \sin^{-1}xdx=x\sin^{-1}x-\int\frac{x}{\sqrt{1-x^{2}}}dx.\]
For integral
\[\int\frac{x}{\sqrt{1-x^{2}}}dx,\]
let \(u=1-x^{2}\). Then \(du=-2xdx\), which gives
\begin{align*} \int\frac{x}{\sqrt{1-x^{2}}}dx & =-\frac{1}{2}\int\frac{du}{\sqrt{u}}\\ & =-\sqrt{u}=-\sqrt{1-x^{2}}.\end{align*}
Therefore, we obtain
\[\int \sin^{-1}xdx=x\sin^{-1}x+\sqrt{1-x^{2}}+C.\]
Similarly, we can obtain the following result
\begin{align*}
\int\tan^{-1}xdx & =x\tan^{-1}x-\frac{1}{2}\ln (1+x^{2})+C\\
\int\sec^{-1}xdx & =x\sec^{-1}x-\ln|x+\sqrt{x^{2}-1}|+C\\
\int\ln x dx & =x\ln x-x+C.
\end{align*}
(1) Calculate integrals of the form
\[\int \sin^{m}x\cos^{n}xdx\mbox{ with \(m\) or \(n\) an odd positive integer.}\]
Suppose that \(n\) is odd. For \(n=1\), we have
\begin{equation}{\label{e3}}\tag{2}
\int\sin^{m}x\cos xdx=\frac{1}{m+1}\sin^{m+1}x+C\mbox{ for }m\neq 1.
\end{equation}
For \(n>1\), we write \(\cos^{n} x=\cos^{n-1}x\cos x\). Since \(n-1\) is even, \(\cos^{n-1}x\) can be expressed in powers of \(\sin^{2}x\) by the formula \(\cos^{2}x=1-\sin^{2}x\). The integral takes the form
\[\int\mbox{(sum of powers of \(\sin x\))}\cdot\cos xdx,\]
which can be broken up into integrals of the form (\ref{e3}). Similarly, if \(m\) is odd, we write \(\sin^{m}x=\sin^{m-1}x\sin x\) and use the substitution \(\sin^{2}x=1-\cos^{2}x\).
Example. We have
\begin{align*}
\int \sin^{2}x\cos^{5} xdx & =\int \sin^{2}x\cos^{4}x\cos xdx\\
& =\int \sin^{2}x(1-\sin^{2}x)^{2}\cos xdx\\
& =\int (\sin^{2}x-2\sin^{4}x+\sin^{6}x)\cos xdx\\
& =\int \sin^{2}x\cos xdx-2\int\sin^{4}x\cos xdx+\int \sin^{6}x\cos xdx\\
& =\frac{1}{3}\sin^{3}x-\frac{2}{5}\sin^{5}x+\frac{1}{7}\sin^{7} x+C.
\end{align*}
and
\begin{align*}
\int \sin^{5}xdx & =\int\sin^{4}x\sin xdx\\
& =\int (1-\cos^{2}x)^{2}\sin xdx\\
& =\int\sin xdx-2\int\cos^{2}x\sin xdx+\int\cos^{4}x\sin xdx\\
& =-\cos x+\frac{2}{3}\cos^{3}x-\frac{1}{5}\cos^{5}x+C.
\end{align*}
(2) Calculate integrals of the form
\[\int\sin^{m}x\cos^{n}xdx\mbox{ with \(m\) and \(n\) both even positive integers}\]
use the following trigonometric identities:
\begin{align*} \sin x\cos x & =\frac{1}{2}\sin 2x\\ \sin^{2}x & =\frac{1}{2}-\frac{1}{2}\cos 2x\\ \cos^{2}x & =\frac{1}{2}+\frac{1}{2}\cos 2x.\end{align*}
Example. We have
\begin{align*}
\int\cos^{2}xdx & =\int (\frac{1}{2}+\frac{1}{2}\cos 2x)dx\\
& =\frac{1}{2}\int dx+\frac{1}{2}\int\cos 2xdx\\
& =\frac{1}{2}x+\frac{1}{4}\sin 2x+C,
\end{align*}
and
\begin{align*}
\int\sin^{2}x\cos^{2}xdx & =\frac{1}{4}\int\sin^{2}2xdx\\
& =\frac{1}{4}\int (\frac{1}{2}-\frac{1}{2}\cos 4x)dx\\
& =\frac{1}{8}\int dx-\frac{1}{8}\int\cos 4xdx\\
& =\frac{1}{8}x-\frac{1}{32}\sin 4x+C
\end{align*}
and
\begin{align*}
\int\sin^{4}x\cos^{2}xdx & =\int (\sin x\cos x)^{2}\sin^{2}xdx\\
& =\int\frac{1}{4}\sin^{2}2x(\frac{1}{2}-\frac{1}{2}\cos 2x)dx\\
& =\frac{1}{8}\int \sin^{2}2xdx-\frac{1}{8}\int \sin^{2}2x\cos 2xdx\\
& =\frac{1}{8}\int (\frac{1}{2}-\frac{1}{2}\cos 4x)dx-\frac{1}{8}\int\sin^{2}2x\cos 2xdx\\
& =\frac{1}{16}x-\frac{1}{64}\sin 4x-\frac{1}{48}\sin^{3}2x+C.
\end{align*}
(3) Derive reduction formulas for integrals of the form
\[\int\sin^{n}xdx\mbox{ and }\int\cos^{n}xdx,\mbox{ where \(n\) is a positive integer.}\]
Prove
\[\int\sin^{n}xdx=-\frac{1}{n}\sin^{n-1}x\cos x+\frac{n-1}{n}\int\sin^{n-2}xdx.\]
Let \(u=\sin^{n-1}x\) and \(dv=\sin xdx\). Then \(du=(n-1)\sin^{n-2}x\cos xdx\) and \(v=-\cos x\). Therefore, we obtain
\begin{align*}
\int\sin^{n}xdx & =-\sin^{n-1}x\cos x+(n-1)\int\sin^{n-2}x\cos^{2}xdx\\
& =-\sin^{n-1}x\cos x+(n-1)\int\sin^{n-2}x(1-\sin^{2}x)dx,
\end{align*}
which implies
\[\int\sin^{n}xdx=-\sin^{n-1}x\cos x+(n-1)\int\sin^{n-2}xdx-(n-1)\int\sin^{n}xdx.\]
Therefore, we obtain the desired result. Similarly, we have the following reduction formula
\[\int\cos^{n}xdx=\frac{1}{n}\cos^{n-1}x\sin x+\frac{n-1}{n}\int\cos^{n-2}xdx.\]
Example. We have
\begin{align*}
\int\sin^{5}xdx & =-\frac{1}{5}\sin^{4}x\cos x+\frac{4}{5}\int\sin^{3}xdx\\
& =-\frac{1}{5}\sin^{4}x\cos x+\frac{4}{5}\left [-\frac{1}{3}\sin^{2}\cos x+\frac{2}{3}\int\sin xdx\right ]\\
& =-\frac{1}{5}\sin^{4}x\cos x-\frac{4}{15}\sin^{2}x\cos x-\frac{8}{15}\cos x+C.
\end{align*}
(4) Calculate integrals of the form
\[\int\sin mx\cos nxdx,\int\sin mx\sin nxdx, \int\cos mx\cos nxdx.\]
If \(m=n\), there is no difficulty. For \(n\neq m\), we use the identities
\begin{align*}
\sin A\cos B & =\frac{1}{2}[\sin (A-B)+\sin (A+B)]\\
\sin A\sin B & = \frac{1}{2}[\cos (A-B)-\cos (A+B)]\\
\cos A\cos B & =\frac{1}{2}[\cos (A-b)+\cos (A+B)].
\end{align*}
These identities follow readily from the familiar addition formulas:
\begin{align*}
\sin (A+B) & =\sin A\cos B+\cos A\sin B\\
\sin (A-B) & =\sin A\cos B-\cos A\sin B\\
\cos (A+B) & =\cos A\cos B-\sin A\sin B\\
\cos (A-B) & =\cos A\cos B+\sin A\sin B.
\end{align*}
Example. We have
\begin{align*}
\int\sin 5x\sin 3xdx & =\int\frac{1}{2}[\cos(5x-3x)-\cos (5x+3x)]dx\\
& =\frac{1}{2}\int [\cos 2x-\cos 8x]dx\\
& =\frac{1}{4}\sin 2x-\frac{1}{16}\sin 8x+C.
\end{align*}
(5) Calculate integrals of the form
\[\int\tan^{n}xdx\mbox{ and }\int\cot^{n}xdx\mbox{ for \(n\geq 2\) an integer}.\]
To integrate \(\tan^{n}x\), we set
\begin{align}
\tan^{n}x & =\tan^{n-2}x\tan^{2}x=(\tan^{n-2}x)(\sec^{2}x-1)\nonumber\\ & =\tan^{n-2}x\sec^{2}x-\tan^{n-2}x.\label{e4}\tag{3}
\end{align}
For \(n-2\geq 2\), we repeat the reduction to get
\begin{align*} \tan^{n}x & =\tan^{n-2}x\sec^{2}x-(\tan^{n-4}x\sec^{2}x-\tan^{n-4}x)\\ & =
\tan^{n-2}x\sec^{2}x-\tan^{n-4}x\sec^{2}x+\tan^{n-4}x.\end{align*}
Continue until the final term is either \(\pm\tan x\) ($n$ odd) or \(\pm 1\) ($n$ even). The idea is to obtain a sum of terms of the form \(\tan^{k}x\sec^{2}x\), pairing a power of \(\tan x\) with \(\sec^{2}x\). These terms will be easy to integrate, since they have the form \(\int u^{k}du\), where \(u=\tan x\) and \(du=\sec^{2}xdx\). The following reduction formula follows immediately from (\ref{e4})
\[\int\tan^{n}xdx=\frac{1}{n-1}\tan^{n-1}x-\int\tan^{n-2}xdx, n\geq 2.\]
For example, we have
\[\int\tan^{6}xdx=\frac{1}{5}\tan^{5}x-\frac{1}{3}\tan^{3}x+\tan x-x+C.\]
Powers of the cotangent function are handled in the same manner given by
\begin{align*} \cot^{n}x & =\cot^{n-2}x\cot^{2}x=\cot^{n-2}x(\csc^{2}x-1)\\ & =\cot^{n-2}\csc^{2}x-\cot^{n-2}x.\end{align*}
The reduction formula is
\[\int\cot^{n}xdx=\frac{-\cot^{n-1}x}{n-1}-\int\cot^{n-2}xdx, n>1.\]
(6) Calculate integrals of the form
\[\int\sec^{n}xdx\mbox{ and }\int\csc^{n}xdx,\mbox{ for \(n\geq 2\) an integer.}\]
For even powers, we write
\begin{align*}
\sec^{n}x & =\sec^{n-2}x\sec^{2}x=(\tan^{2}x+1)^{(n-2)/2}\sec^{2}x\mbox{ and put \(u=\tan x\)},\\
\csc^{n}x & =\csc^{n-2}x\csc^{2}x=(\cot^{2}x+1)^{(n-2)/2}\csc^{2}x\mbox{ and put \(u=\cot x\)}
\end{align*}
Example. We have
\begin{align*}
\int\sec^{6}xdx & =\int\sec^{4}x\sec^{2}xdx\\
& =\int (\tan^{2}x+1)^{2}\sec^{2}xdx\\
& =\int (u^{2}+1)^{2}du\mbox{ \((u=\tan x,du=\sec^{2}xdx\))}\\
& =\frac{1}{5}u^{5}+\frac{2}{3}u^{3}+u+C\\
& =\frac{1}{5}\tan^{5}x+\frac{2}{3}\tan^{3}x+\tan x+C.
\end{align*}
Now, we can use integration by parts to integrate odd powers. For \(\sec^{n}x\), we set \(u=\sec^{n-2}x\) and \(dv=\sec^{2}xdx\). When \(\tan^{2}x\) appears, we use the identity \(\tan^{2}x=\sec^{2}x-1\). We can handle \(\csc^{n}x\) in a similar manner.
Example. Calculate
\[\int\sec^{3}xdx.\]
Let \(u=\sec x\) and \(dv=\sec^{2}xdx\). Then \(du=\sec x\tan xdx\) and \(v=\tan x\). Therefore, we obtain
\begin{align*}
\int\sec^{3}xdx & =\int\sec x\sec^{2}xdx\\
& =\sec x\tan x-\int\tan^{2}x\sec xdx\\
& =\sec x\tan x-\int (\sec^{2}x-1)\sec xdx\\
& =\sec x\tan x-\int\sec^{3}xdx+\int\sec xdx,
\end{align*}
which implies
\[\int\sec^{3}xdx=\sec x\tan x-\int\sec^{3}xdx+\ln|\sec x+\tan x|.\]
Finally, we obtain
\[\int\sec^{3}xdx=\frac{1}{2}\sec x\tan x+\frac{1}{2}\ln|\sec x+\tan x|+C.\]
The integration by parts method used to integrate odd powers of the secant or cosecant can be used to derive reduction formulas that incorporate both the even and odd cases simultaneously. Let \(u=\sec^{n-2}xdx\) and \(dv=\sec^{2}xdx\). Then \(du=(n-2)\sec^{n-2}x\tan xdx\) and \(v=\tan x\). Therefore, we obtain
\begin{align*}
\int\sec^{n}xdx & =\sec^{n-2}x\tan x-(n-2)\int\sec^{n-2}x\tan^{2}xdx\\
& =\sec^{n-2}x\tan x-(n-2)\int\sec^{n-2}x(\sec^{2}x-1)dx\\
& =\sec^{n-2}x\tan x-(n-2)\int\sec^{n}xdx+(n-2)\int\sec^{n-2}xdx.
\end{align*}
The reduction formula is given by
\begin{equation}{\label{e5}}\tag{4}
\int\sec^{n}xdx=\frac{1}{n-1}\sec^{n-2}x\tan x+\frac{n-2}{n-1}\int\sec^{n-2}xdx, n\geq 2.
\end{equation}
For example, we have
\begin{align*}
\int\sec^{6}xdx & =\frac{1}{5}\sec^{4}x\tan x+\frac{4}{5}\int\sec^{4}xdx\\
& =\frac{1}{5}\sec^{4}x\tan x+\frac{4}{5}\left [\frac{1}{3}\sec^{2}x\tan x+\frac{2}{3}\int\sec^{2}xdx\right ]\\
& =\frac{1}{5}\sec^{4}x\tan x+\frac{4}{15}\sec^{2}x\tan x+\frac{8}{15}\tan x+C.
\end{align*}
The reduction formula for \(\int\csc^{n}xdx\) is given by
\[\int\csc^{n}xdx=\frac{-\csc^{n-2}x\cot x}{n-1}+\frac{n-2}{n-1}\int\csc^{n-2} xdx.\]
(7) Calculate integrals of the form
\[\int\tan^{m}x\sec^{n}xdx\mbox{ and }\int\cot^{m}x\csc^{n}xdx,\mbox{ for \(m\), \(n\) positive integers.}\]
When \(n\) is even, we write
\[\tan^{m}x\sec^{n}x=\tan^{m}x\sec^{n-2}x\sec^{2}x\]
and express \(\sec^{n-2}x\) entirely in terms of \(\tan^{2}x\) using \(\sec^{2}x=\tan^{2}x+1\). For example, we have
\begin{align*}
\int\tan^{5}x\sec^{4}xdx & =\int\tan^{5}x\sec^{2}x\sec^{2}xdx\\
& =\int\tan^{5}x(\tan^{2}x+1)\sec^{2}xdx\\
& =\int\tan^{7}x\sec^{2}xdx+\int\tan^{5}x\sec^{2}xdx\mbox{ (let \(u=\tan x\))}\\
& =\frac{1}{8}\tan^{8}x+\frac{1}{6}\tan^{6}x+C.
\end{align*}
When \(n\) and \(m\) are both odd, we write
\[\tan^{m}x\sec^{n}x=\tan^{m-1}x\sec^{n-1}x\sec x\tan x\]
and express \(\tan^{m-1}x\) entirely in terms of \(\sec^{2}x\) using \(\tan^{2}x=\sec^{2}x-1\). For example, we have
\begin{align*}
\int\tan^{5}x\sec^{3}xdx & =\int\tan^{4}x\sec^{2}x\sec x\tan xdx\\
& =\int (\sec^{2} x-1)^{2}\sec^{2}x\sec x\tan xdx\\
& =\int (\sec^{6}x-2\sec^{4}x+\sec^{2}x)\sec x\tan xdx\mbox{ (let \(u=\sec x\))}\\
& =\frac{1}{7}\sec^{7}x-\frac{2}{5}\sec^{5}x+\frac{1}{3}\sec^{3}x+C.
\end{align*}
Finally, if \(n\) is odd and \(m\) is even, we use \(\tan^{2}x=\sec^{2}x-1\) to write the product as a sum of odd powers of the secant. Then, we can either use integration by parts as in the above just given, or the reduction formula (\ref{e5}). For example, we have
\begin{align*}
\int\tan^{2}x\sec xdx & =\int (\sec^{2}x-1)\sec xdx\\
& =\int\sec^{3}xdx-\int\sec xdx\\
& =\frac{1}{2}\sec x\tan x+\frac{1}{2}\ln |\sec x+\tan x|-\ln |\sec x+\tan x|+C\\
& =\frac{1}{2}\sec x\tan x-\frac{1}{2}\ln |\sec x+\tan x|+C.
\end{align*}
We can handle integrals of \(\cot^{m}x\csc^{n}x\) in a similar manner.
\begin{equation}{\label{b}}\tag{B}\mbox{}\end{equation}
Trigonometric Substitutions.
Integrals involving one of the forms \(\sqrt{a^{2}-x^{2}}\), \(\sqrt{a^{2}+x^{2}}\) or \(\sqrt{x^{2}-a^{2}}\) can often be simplified by making a trigonometric substitution. These substitutions transform the integrand into a trigonometric form like those studied in the preceding discussions. The three cases with their suggested substitutions are given by
\begin{align*}
&\mbox{For \(\sqrt{a^{2}-x^{2}}\), set \(a\sin u=x\).}\\
& \mbox{For \(\sqrt{a^{2}+x^{2}}\), set \(a\tan u=x\).}\\
&\mbox{For \(\sqrt{x^{2}-a^{2}}\), set \(a\sec u=x\).}
\end{align*}
In each case, take \(a>0\). To illustrate the idea behind these substitutions, consider the first case \(\sqrt{a^{2}-x^{2}}\). Whenwe set \(a\sin u=x\), we have
\[\sqrt{a^{2}-x^{2}}=\sqrt{a^{2}-a^{2}\sin^{2}u}=a|\cos u|.\]
Since \(a\sin u=x\), we have \(u=\sin^{-1}(x/a)\), which implies \(-\pi /2\leq u\leq\pi /2\). Therefore, we have \(\cos u\geq 0\) and \(\sqrt{a^{2}-x^{2}}= a\cos u\). This says that the substitution \(a\sin u=x\) has the effect of replacing the radical \(\sqrt{a^{2}-x^{2}}\) by \(a\cos u\). Similarly, for setting \(a\tan u=x\), we have \(\sqrt{a^{2}+x^{2}}=a\sec u\), and, for setting \(a\sec u=x\), we have \(\sqrt{x^{2}-a^{2}}=a\tan u\).
Example. Find
\[\int \frac{dx}{(9-x^{2})^{3/2}}.\]
Let \(3\sin u=x\). Then \(3\cos udu=dx\). Therefore, we obtain
\begin{align*} \int\frac{dx}{(9-x^{2})^{3/2}} & =\int\frac{dx}{(\sqrt{9-x^{2}})^{3}}\\ & =\int\frac{3\cos u}{(3\cos u)^{3}}du\\ & =\frac{1}{9}\int\sec^{2}udu\\ & =\frac{1}{9}\tan u+C\\ & =\frac{x}{9\sqrt{9-x^{2}}}+C.\end{align*}
Example. Find
\[\int\sqrt{a^{2}+x^{2}}dx.\]
Let \(a\tan u=x\). Then \(a\sec^{2}udu=dx\). Therefore, we obtain
\begin{align*}
\int\sqrt{a^{2}+x^{2}} & =\int (a\sec u)a\sec^{2}udu\\
& =a^{2}\int\sec^{3}udu\\
& =\frac{a^{2}}{2}(\sec u\tan u+\ln |\sec u+\tan u|)+C\\
& =\frac{a^{2}}{2}\left [\frac{\sqrt{a^{2}+x^{2}}}{a}\left (\frac{x}{a}\right )+\ln\left |\frac{\sqrt{a^{2}+x^{2}}}{a}+\frac{x}{a}\right |\right ]+C\\
& =\frac{1}{2}x\sqrt{a^{2}+x^{2}}+\frac{1}{2}a^{2}\ln (x+\sqrt{a^{2}+x^{2}})-\frac{1}{2}a^{2}\ln a+C\\
& =\frac{1}{2}x\sqrt{a^{2}+x^{2}}+\frac{1}{2}a^{2}\ln (x+\sqrt{a^{2}+x^{2}})+C
\end{align*}
Example. Find
\[\int\frac{dx}{x^{2}\sqrt{x^{2}-4}}.\]
Let \(2\sec u=x\). Then \(2\sec u\tan udu=dx\). Therefore, we obtain
\begin{align*} \int\frac{dx}{x^{2}\sqrt{x^{2}-4}} & =\int\frac{2\sec u\tan u}
{4\sec^{2}u\cdot 2\tan u}du\\ & =\frac{1}{4}\int\cos udu\\ & =\frac{1}{4}\sin u+C\\ & =
\frac{\sqrt{x^{2}-4}}{4x}+C.\end{align*}
Example. Find
\[\int\frac{dx}{x\sqrt{4x^{2}+9}}.\]
Let \(3\tan u=2x\). Then \(3\sec^{2}udu=2dx\). Therefore, we obtain
\begin{align*} \int\frac{dx}{x\sqrt{4x^{2}+9}} & =\int\frac{\frac{3}{2}\sec^{2}u}{\frac{3}{2}
\tan u\cdot 3\sec u}du\\ & =\frac{1}{3}\int\csc udu\\ & =\frac{1}{3}\ln |\csc u-
\cot u|+C\\ & =\frac{1}{3}\ln\left |\frac{\sqrt{4x^{2}+9}-3}{2x}\right |+C.\end{align*}
Example. Find
\[\int\frac{xdx}{\sqrt{x^{2}+2x-3}}.\]
We first have
\[\int\frac{xdx}{\sqrt{x^{2}+2x-3}}=\int\frac{xdx}{\sqrt{(x+1)^{2}-4}}.\]
Let \(2\sec u=x+1\). Then \(2\sec u\tan udu=dx\). Therefore, we obtain
\begin{align*}
\int\frac{xdx}{\sqrt{(x+1)^{2}-4}} & =\int\frac{(2\sec u-1)2\sec u\tan u}{2\tan u}du\\ & =\int (2\sec^{2}u-\sec u)du\\ & =2\tan u-\ln |\sec u+\tan u|+C\\ & =\sqrt{x^{2}+2x-3}-\ln\left |\frac{x+1+\sqrt{x^{2}+2x-3}}{2}\right |+C.
\end{align*}
The reduction formula
\[\int\frac{dx}{(x^{2}+a^{2})^{n}}=\frac{1}{a^{2n-1}}\int\cos^{2(n-1)}udu\]
follows from the substitution \(a\tan u=x\) and \(a\sec^{2}udu=dx\).
\begin{equation}{\label{c}}\tag{C}\mbox{}\end{equation}
Partial Fractions.
For
\[\frac{1}{x^{2}-4},\]
we write
\[\frac{1}{x^{2}-4}=\frac{A}{x-2}+\frac{B}{x+2}.\]
Clearing the fractions, we have \(1=A(x+2)+B(x-2)\). Setting \(x=2\), we get \(A=\frac{1}{4}\). Setting \(x=-2\), we get \(B=-\frac{1}{4}\). In general, each distinct linear factor \(x-\alpha\) in the denominator gives rise to a term of the form
\[\frac{A}{x-\alpha}.\]
For
\[\frac{2x^{2}+3}{x(x-1)^{2}},\]
we write
\[\frac{2x^{2}+3}{x(x-1)^{2}}=\frac{A}{x}+\frac{B}{x-1}+\frac{C}{(x-1)^{2}}.\]
This leads to \(2x^{2}+3=A(x-1)^{2}+Bx(x-1)+Cx\). Setting \(x=0\), we get \(A=3\). Setting \(x=1\), we get \(C=5\). Setting \(x=2\), we get \(11=A+2B+2C\), which gives \(B=-1\). In general, each factor of the form \((x-\alpha )^{k}\) in the denominator gives rise to an expression of the form
\[\frac{A_{1}}{x-\alpha}+\frac{A_{2}}{(x-\alpha )^{2}}+\cdots +\frac{A_{k}}{(x-\alpha )^{k}}.\]
For
\[\frac{x^{2}+5x+2}{(x+1)(x^{2}+1)},\]
we write
\[\frac{x^{2}+5x+2}{(x+1)(x^{2}+1)}=\frac{A}{x+1}+\frac{Bx+C}{x^{2}+1}\]
and obtain \(x^{2}+5x+2=A(x^{2}+1)+(Bx+C)(x+1)\). Setting \(x=-1\), we get \(-2=2A\) which gives \(A=-1\). Setting \(x=0\), we get \(2=A+C\) which gives \(C=3\). Setting \(x=1\), we get \(8=2A+2B+2C\), which gives \(B=2\). For
\[\frac{1}{x(x^{2}+x+1)},\]
we write
\[\frac{1}{x(x^{2}+x+1)}=\frac{A}{x}+\frac{Bx+C}{x^{2}+x+1}\]
and obtain \(1=A(x^{2}+x+1)+(Bx+C)x\). Now, we have
\begin{align*}
1 & =A\mbox{ by setting \(x=0\)}\\
1 & =3A+B+C\mbox{ by setting \(x=1\)}\\
1 & =A+B-C\mbox{ by setting \(x=-1\)}
\end{align*}
Then, we obtain \(A=1\), \(B=-1\) and \(C=-1\). In general, each irreducible quadratic factor \(x^{2}+\beta x+\gamma\) in the denominator gives rise to a term of the form
\[\frac{Ax+B}{x^{2}+\beta x+\gamma}.\]
For
\[\frac{3x^{4}+x^{3}+20x^{2}+3x+31}{(x+1)(x^{2}+4)^{2}},\]
we write
\[\frac{3x^{4}+x^{3}+20x^{2}+3x+31}{(x+1)(x^{2}+4)^{2}}=\frac{A}{x+1}+\frac{Bx+C}{x^{2}+4}+\frac{Dx+E}{(x^{2}+4)^{2}}.\]
This gives
\[3x^{4}+x^{3}+20x^{2}+3x+31=A(x^{2}+4)^{2}+(Bx+C)(x+1)(x^{2}+4)+(Dx+E)(x+1).\]
Then, we have
\begin{align*}
50 & =25A\mbox{ by setting \(x=-1\)}\\
31 & =16A+4C+E\mbox{ by setting \(x=0\)}\\
58 & =25A+10B+10C+2D+2E\mbox{ by setting \(x=1\)}\\
173 & =64A+48B+24C+6D+3E\mbox{ by setting \(x=2\)}\\
145 & =64A+16B-8C+2D-E\mbox{ by setting \(x=-2\)}
\end{align*}
Therefore, we obtain \(A=2\), \(B=1\), \(C=0\), \(D=0\) and \(E=-1\). In general, each multiple irreducible quadratic factor \((x^{2}+\beta x+\gamma )^{k}\) in the denominator gives rise to an expression of the form
\[\frac{A_{1}x+B_{1}}{x^{2}+\beta x+\gamma}+\frac{A_{2}x+B_{2}}{(x^{2}+\beta x+\gamma )^{2}}+\cdots +
\frac{A_{k}x+B_{k}}{(x^{2}+\beta x+\gamma )^{k}}.\]
For the improper rational function
\[\frac{x^{5}+2}{x^{2}-1},\]
we see have
\begin{align*} \frac{x^{5}+2}{x^{2}-1} & =x^{3}+x+\frac{x+2}{x^{2}-1}\\ & =x^{3}+x-\frac{1}{2(x+1)}+\frac{3}{2(x-1)}.\end{align*}
We have been decomposing rational functions into partial fractions so as to be able to integrate them.
Example. We have
\begin{align*} \int\frac{dx}{x^{2}-4} & =\frac{1}{4}\int\left (\frac{1}{x-2}-\frac{1}{x+2}\right )dx\\ & =\frac{1}{4}(\ln |x-2|-\ln |x+2|)+C\\ & =\frac{1}{4}\ln\left |\frac{x-2}{x+2}\right |+C.\end{align*}
Example. We have
\begin{align*}
\int\frac{2x^{2}+3}{x(x-1)^{2}}dx & =\int\left [\frac{3}{x}-\frac{1}{x-1}+\frac{5}{(x-1)^{2}}\right ]dx\\
& =3\ln |x|-\ln |x-1|-\frac{5}{x-1}+C\\
& =\ln\left |\frac{x^{3}}{x-1}\right |-\frac{5}{x-1}+C.
\end{align*}
Example. We have
\begin{align*} \int\frac{x^{2}+5x+2}{(x+1)(x^{2}+1)}dx & =\int\left (\frac{-1}{x+1}+\frac
{2x+3}{x^{2}+1}\right )dx\\ & =-\int\frac{dx}{x+1}+\int\frac{2x+3}{x^{2}+1}dx.\end{align*}
Now
\begin{align*} \int\frac{2x+3}{x^{2}+1}dx & =\int\frac{2x}{x^{2}+1}dx+3\int\frac{dx}{x^{2}+1}\\ & =\ln (x^{2}+1)+3\tan^{-1}x+C,\end{align*}
we have
\begin{align*} \int\frac{x^{2}+5x+2}{(x+1)(x^{2}+1)}dx & =-\ln |x+1|+\ln (x^{2}+1)+3\tan^{-1}x+C\\ & =\ln\left |\frac{x^{2}+1}{x+1}\right |+3\tan^{-1}x+C.\end{align*}
Example. We have
\begin{align*} \int\frac{dx}{x(x^{2}+x+1)} & =\int\left (\frac{1}{x}-\frac{x+1}{x^{2}+x+1}\right )dx\\ & =\ln |x|-\int\frac{x+1}{x^{2}+x+1}dx.\end{align*}
Since
\begin{align*} \frac{x+1}{x^{2}+x+1} & =\frac{\frac{1}{2}(2x+1)+\frac{1}{2}}{x^{2}+x+1}\\ & =
\frac{1}{2}\frac{2x+1}{x^{2}+x+1}+\frac{1}{2}\frac{1}{x^{2}+x+1},\end{align*}
we have
\[\int\frac{x+1}{x^{2}+x+1}dx=\frac{1}{2}\ln (x^{2}+x+1)+\frac{1}{2}\int\frac{dx}{x^{2}+x+1}+C_{1}.\]
Now, we have
\begin{align*} \frac{1}{2}\int\frac{dx}{x^{2}+x+1} & =\frac{1}{2}\int\frac{dx}
{(x+\frac{1}{2})^{2}+(\frac{\sqrt{3}}{2})^{2}}\\ & =\frac{1}{\sqrt{3}}\tan^{-1}
\left [\frac{2}{\sqrt{3}}\left (x+\frac{1}{2}\right )\right ]+C_{2},\end{align*}
which implies
\[\int\frac{dx}{x(x^{2}+x+1)}=\ln |x|-\frac{1}{2}\ln (x^{2}+x+1)-\frac{1}{\sqrt{3}}\tan^{-1}\left [\frac{2}{\sqrt{3}}\left (x+\frac{1}{2}\right )\right ]+C.\]
Example. We have
\begin{align*}
\int\frac{3x^{4}+x^{3}+20x^{2}+3x+31}{(x+1)(x^{2}+4)^{2}}dx & =\int\left [\frac{2}{x+1}+\frac{x}{x^{2}+4}-\frac{1}{(x^{2}+4)^{2}}\right ]dx\\
& =2\ln |x+1|+\frac{1}{2}\ln (x^{2}+4)-\int\frac{dx}{(x^{2}+4)^{2}}+C_{1}.
\end{align*}
For the integral
\[\int\frac{dx}{(x^{2}+4)^{2}},\]
let \(2\tan u=x\). Then, we have
\begin{align*}
\int\frac{dx}{(x^{2}+4)^{2}} & =\frac{1}{8}\int\cos^{2}udu\\
& =\frac{1}{16}\int (1+\cos 2u)du\\
& =\frac{1}{16}u+\frac{1}{32}\sin 2u+C_{2}\\
& =\frac{1}{16}u+\frac{1}{16}\sin u\cos u+C_{2}\\
& =\frac{1}{16}\tan^{-1}\frac{x}{2}+\frac{1}{16}\left (\frac{x}{\sqrt{x^{2}+4}}\right )\left (\frac{2}{\sqrt{x^{2}+4}}\right )+C_{2}\\
& =\frac{1}{16}\tan^{-1}\frac{x}{2}+\frac{1}{8}\frac{x}{x^{2}+4}+C_{2}.
\end{align*}
Therefore, we obtain
\[\int\frac{3x^{4}+x^{3}+20x^{2}+3x+31}{(x+1)(x^{2}+4)^{2}}dx=2\ln |x+1|+\frac{1}{2}\ln (x^{2}+4)-\frac{1}{8}\frac{x}{x^{2}+4}-\frac{1}{16}\tan^{-1}\frac{x}{2}+C.\]
Example. We have
\begin{align*} \int\frac{x^{5}+2}{x^{2}-1}dx & =\int\left [x^{3}+x-\frac{1}{2(x+1)}+\frac{3}
{2(x-1)}\right ]dx\\ & =\frac{1}{4}x^{4}+\frac{1}{2}x^{2}-\frac{1}{2}\ln |x+1|+\frac{3}{2}\ln |x-1|+C.\end{align*}
\begin{equation}{\label{d}}\tag{D}\mbox{}\end{equation}
Rationalizing Substitutions.
Example. Find
\[\int\frac{dx}{1+\sqrt{x}}.\]
To ratinalize the integrand, let \(u^{2}=x\). Then \(2udu=dx\). Therefore, we obtain
\begin{align*} \int\frac{dx}{1+\sqrt{x}} & =\int\frac{2u}{1+u}du\\ & =\int\left (2-\frac{2}{1+u}
\right )du\\ & =2u-2\ln |1+u|+C\\ & =2\sqrt{x}-2\ln |1+\sqrt{x}|+C.\end{align*}
Example. Find
\[\int\frac{dx}{\sqrt[3]{x}+\sqrt{x}}.\]
To rationalize the integrand, let \(u^{6}=x\). Then \(6u^{5}du=dx\). Therefore, we obtain
\begin{align*}
\int\frac{dx}{\sqrt[3]{x}+\sqrt{x}} & =\int\frac{6u^{5}du}{u^{2}+u^{3}}\\ & =6\int\frac{u^{3}du}{1+u}\\ & =6\int\left (u^{2}-u+1-\frac{1}{1+u}\right )du\\ & =2\sqrt{x}-3\sqrt[3]{x}+6\sqrt[6]{x}-6\ln |1+\sqrt[6]{x}|+C.
\end{align*}
Example. Find
\[\int\sqrt{1-e^{x}}dx.\]
To rationalize the integrand, let \(u^{2}=1-e^{x}\). Then \(1-u^{2}=e^{x}\), \(\ln (1-u^{2})=x\) and \(-\frac{2u}{1-u^{2}}du=dx\). Therefore, we
\begin{align*}
\int\sqrt{1-e^{x}}dx & =\int u\left (\frac{-2u}{1-u^{2}}\right )du\\ & =\int\left (2+\frac{1}{u-1}-\frac{1}{u+1}\right )du\\ & =2u+\ln\left |\frac{u-1}
{u+1}\right |+C\\ & =2\sqrt{1-e^{x}}+\ln\left |\frac{\sqrt{1-e^{x}}-1}{\sqrt{1-e^{x}}+1}\right |+C.
\end{align*}
The second type of rationalizing substitution is applied to integrands which are rational expression in sine and cosine. For example, suppose we want to calculate
\[\int\frac{\cos x}{\sin x+\sin^{2}x}dx.\]
To convert a rational expression in sine and cosine to a rational function in \(u\), we use the substitution \(u=\tan\left (\frac{x}{2}\right )\) for \(-\pi<x<\pi\). Then, we have
\begin{align*} \cos\left (\frac{x}{2}\right ) & =\frac{1}{\sec (x/2)}\\ & =\frac{1}{\sqrt{1+\tan^{2}(x/2)}}\\ & =\frac{1}{\sqrt{1+u^{2}}},\end{align*}
and
\begin{align*} \sin\left (\frac{x}{2}\right ) & =\cos\left (\frac{x}{2}\right )\tan\left (\frac{x}{2}\right )\\ & =\frac{u}{\sqrt{1+u^{2}}}.\end{align*}
Now, we also have
\begin{align*} \sin x & =2\sin\left (\frac{x}{2}\right )\cos\left (\frac{x}{2}\right )\\ & =\frac{2u}{1+u^{2}},\end{align*}
and
\begin{align*} \cos x & =\cos^{2}\left (\frac{x}{2}\right )-\sin^{2}\left (\frac{x}{2}\right )\\ & =\frac{1-u^{2}}{1+u^{2}}.\end{align*}
Since \(u=\tan (x/2)\) and \(x=2\tan^{-1}u\), it follows
\[dx=\frac{2}{1+u^{2}}du.\]
To summarize, if an integrand is a rational expression in sine and cosine, then the substitution
\[\sin x=\frac{2u}{1+u^{2}}, \quad\cos x=\frac{1-u^{2}}{1+u^{2}}\mbox{ and }dx=\frac{2}{1+u^{2}}du,\]
where \(u=\tan (x/2)\) for \(-\pi <x<\pi\), will convert the integrand into a rational function in \(u\).
Example. Find
\[\int\frac{\cos x}{\sin x+\sin^{2}x}dx.\]
Let \(u=\tan (x/2)\). Then, we have
\begin{align*} \frac{\cos x}{\sin x+\sin^{2}x} & =\frac{(1-u^{2})/(1+u^{2})}{[2u/(1+u^{2})]+[4u^{2}/(1+u^{2})^{2}]}\\ & =\frac{(1-u^{2})(1+u^{2})}{2u^{3}+4u^{2}+2u}\\ & =\frac{(1-u)(1+u^{2})}{2u(1+u)}\end{align*}
and
\begin{align*} \int\frac{\cos x}{\sin x+\sin^{2}x}dx & =\int\frac{(1-u)(1+u^{2})}
{2u(1+u)}\cdot\frac{2}{1+u^{2}}du\\ & =\int\frac{1-u}{u(1+u)}du.\end{align*}
Now, we also have
\[\frac{1-u}{u(1+u)}=\frac{1}{u}-\frac{2}{1+u},\]
which implies
\begin{align*} \int\frac{1-u}{u(1+u)}du & =\ln |u|-2\ln |1+u|+C\\ & =\ln\left |\frac{u}
{(1+u)^{2}}\right |+C\\ & =\ln\left |\frac{\tan (x/2)}{[1+\tan (x/2)]^{2}}\right |+C.\end{align*}
\begin{equation}{\label{e}}\tag{E}\mbox{}\end{equation}
Numerical Integration.
To evaluate a definite integral by the formula
\[\int_{a}^{b} f(x)dx=F(b)-F(a)\]
we must be able to find an anti-derivative \(F\) and we must be able to evaluate this anti-derivative both at \(a\) and \(b\). However the method fails even for
such simple-looking integrals as
\[\int_{0}^{1}\sqrt{x}\sin xdx\mbox{ and }\int_{0}^{1}e^{-x^{2}}dx,\]
where are no elementary functions with derivatives \(\sqrt{x}\sin x\) and \(e^{-x^{2}}\). We focus on
\[\int_{a}^{b} f(x)dx.\]
Suppose that \(f\) is continuous on \([a,b]\) and, for convenience, assume that \(f\) is positive. Take a regular partition \(P=\{x_{1},x_{2},\cdots ,x_{n}\}_{n=1}^{\infty}\) of \([a,b]\), subdividing the interval into \(n\) sub-intervals each of length \((b-a)/n\):
\[[a,b]=[x_{0},x_{1}]\cup\cdots\cup\cdots [x_{i-1},x_{i}]\cup\cdots\cup[x_{n-1},x_{n}]\]
with \(\Delta x_{i}=\frac{b-a}{n}\).
(i) (The left-endpoint estimate). The area is given by
\[\mbox{area}=f(x_{i-1})\Delta x_{i}=f(x_{i-1})\left (\frac{b-a}{n}\right ).\]
Then, we have
\[L_{n}=\frac{b-a}{n}[f(x_{0})+f(x_{1})+\cdots +f(x_{n-1})].\]
(ii) (The right-endpoint estimate). The area is given by
\[\mbox{area}=f(x_{i})\Delta x_{i}=f(x_{i})\left (\frac{b-a}{n}\right ).\]
Then, we have
\[R_{n}=\frac{b-a}{n}[f(x_{1})+f(x_{2})+\cdots +f(x_{n})].\]
(iii) (The midpoint estimate). The area is given by
\begin{align*} \mbox{area} & =f\left (\frac{x_{i-1}+x_{i}}{2}\right )\Delta x_{i}\\ & =f\left (\frac{x_{i-1}+x_{i}}{2}\right )\left (\frac{b-a}{n}\right ).\end{align*}
Then, we have
\[M_{n}=\frac{b-1}{n}\left [f\left (\frac{x_{0}+x_{1}}{2}\right )+\cdots +f\left (\frac{x_{n-1}+x_{n}}{2}\right )\right ].\]
(iv) (The trapezoidal estimate: trapezoidal rule). The area is given by
\begin{align*} \mbox{area} & =\frac{1}{2}[f(x_{i-1})+f(x_{i})]\Delta x_{i}\\ & =\frac{1}{2}[f(x_{i-1})+f(x_{i})]\left (\frac{b-a}{n}\right ).\end{align*}
Then, we have
\begin{align*}
T_{n} & =\frac{b-a}{n}\left [\frac{f(x_{0})+f(x_{1})}{2}+\frac{f(x_{1})+f(x_{2})}{2}+\cdots +\frac{f(x_{n-1})+f(x_{n})}{2}\right ]\\
& =\frac{b-a}{2n}[f(x_{0})+2f(x_{1})+\cdots +2f(x_{n-1})+f(x_{n})].
\end{align*}
(v) (The parabolic estimate: Simpson’s rule). We take the parabola \(y=Ax^{2}+Bx+C\) that passes through the three points with \(x\)-coordinate \(x_{i-1}\), \(\frac{x_{i-1}+x_{i}}{2}\) and \(x_{i}\). We can show that the function \(g(x)=Ax^{2}+Bx+C\) satisfies the condition
\[\int_{a}^{b} g(x)dx=\frac{b-a}{6}\left [g(a)+4g\left (\frac{a+b}{2}\right )+g(b)\right ]\]
for every interval \([a,b]\). Therefore, the area is given by
\[\mbox{area}=\left [f(x_{i-1})+4f\left (\frac{x_{i-1}+x_{i}}{2}\right )+f(x_{i})\right ]\left (\frac{b-a}{6n}\right ).\]
Therefore, we obtain
\[S_{n}=\frac{b-a}{6n}\left\{f(x_{0})+f(x_{n})+2[f(x_{1})+\cdots +f(x_{n-1})]+4\left [f\left (\frac{x_{0}+x_{1}}{2}\right )+\cdots +f\left (\frac{x_{n-1}+x_{n}}{2}\right )\right ]\right\}.\]
Example. Find the approximate value of
\[\int_{0}^{3}\sqrt{4+x^{3}}dx\]
by the trapezodial rule and Simpson’s rule. Take \(n=6\), each sub-interval has length \((b-a)/n=(3-0)/6=1/2\). The partition points are \(x_{0}=0\), \(x_{1}=1/2\), \(x_{2}=1\), \(x_{3}=3/2\), \(x_{4}=2\), \(x_{5}=5/2\) and \(x_{6}=3\). Now, we have
\[T_{6}=\frac{1}{4}\left [f(x_{0})+2f\left (\frac{1}{2}\right )+2f(1)+2f\left (\frac{3}{2}\right )+2f(2)+2f\left (\frac{5}{2}\right )+f(3)\right ]\]
with \(f(x)=\sqrt{4+x^{3}}\). Using the calculator and rounding off to the three decimal places, we have \(T_{6}\approx 9.331\). Now, we take \(n=3\) for the Simpson’s rule. There are three sub-intervals each of length \((b-a)/n=(3-0)/3=1\). We take \(x_{0}=0\), \(x_{1}=1\), \(x_{2}=2\) and \(x_{3}=3\). Then, we have \(\frac{x_{0}+x_{1}}{2}=\frac{1}{2}\), \(\frac{x_{1}+x_{2}}{2}=\frac{3}{2}\) and \(\frac{x_{2}+x_{3}}{2}=\frac{5}{2}\). The Simpson’s rule yields
\[S_{3}=\frac{1}{6}\left [f(0)+f(3)+2f(1)+2f(2)+4f\left (\frac{1}{2}\right )+4f\left (\frac{3}{2}\right )+4f\left (\frac{5}{2}\right )\right ]\]
with \(f(x)=\sqrt{4+x^{3}}\). Then, we have \(S_{3}\approx 9.279\). \(\sharp\)
It is shown in texts on numerical analysis that, when \(f\) is continuous on \([a,b]\) and twice differentiable on \((a,b)\), the theoretical error of the trapezoidal rule
\[E_{n}^{T}=\int_{a}^{b} f(x)dx-T_{n}\]
can be written as
\[E_{n}^{T}=-\frac{(b-a)^{3}}{12n^{2}}f”(c),\]
where \(c\in [a,b]\). Usually we cannot pinpoint \(c\) any further. However, if \(f”(x)\) is bounded on \([a,b]\), that is, if there is a constant \(M\) satisfying \(|f”(x)|\leq M\) for \(a\leq x\leq b\), then we have
\[|E_{n}^{T}|\leq\frac{(b-a)^{3}}{12n^{2}}M.\]
We can use the trapezoidal rule to find the estimate
\[\ln 2=\int_{1}^{2}\frac{dx}{x}\approx 0.696.\]
by taking \(n=5\). Then \((b-a)/n=1/5\), \(x_{0}=5/5\), \(x_{1}=6/5\), \(x_{2}=7/5\), \(x_{3}=8/5\), \(x_{4}=9/5\) and \(x_{5}=10/5\). Therefore, we have
\[T_{5}=\frac{1}{10}\left (\frac{5}{5}+\frac{10}{6}+\frac{10}{7}+\frac{10}{8}+\frac{10}{9}+\frac{5}{10}\right )\approx 0.6957\]
and
\[S_{5}=\frac{1}{30}\left [\frac{5}{5}+\frac{5}{10}+2\left (\frac{5}{6}+\frac{5}{7}+\frac{5}{8}+\frac{5}{9}\right )+4\left (\frac{10}{11}+
\frac{10}{13}+\frac{10}{15}+\frac{10}{17}+\frac{10}{19}\right )\right ]\approx 0.6935,\]
where \(f”(x)=2/x^{3}\). It is easy to see \(|f”(x)|\leq 2\) for \(1\leq x\leq 2\). Therefore, we have
\[|E_{5}^{T}|\leq\frac{(2-1)^{3}}{12\cdot 5^{2}}\cdot 2=\frac{1}{150}.\]
The estimate \(0.696\) is in theoretical error by less than \(1/150\). Suppose, on the other hand, that we want an estimate for
\[\ln 2=\int_{1}^{2}\frac{dx}{x}\]
that is accurate to four decimal places. Then we need
\[\frac{(b-a)^{3}}{12n^{2}}M<0.00005.\]
Since
\[\frac{(b-a)^{3}}{12n^{2}}M\leq\frac{1}{12n^{2}}\cdot 2=\frac{1}{6n^{2}},\]
we can guarantee \(1/6n^{2}<0.00005\), which is equivalent to \(n^{2}>3333\). As we can check, \(n=58\) is the smallest integer that satisfies the above inequality. Thus, the trapezoidal rule requires a regular partition with at least \(58\) points to guarantee four-decimal-place accuracy in the approximation of \(\int_{1}^{2}\frac{dx}{x}\).
The Simpson’s rule is more effective than the trapezoidal rule. Let \(f\) be continuous on \([a,b]\). If \(f^{(4)}\) exists on \((a,b)\), then the theoretical error for Simpson’s rule
\[E_{n}^{S}=\int_{a}^{b} f(x)dx-S_{n}\]
can be written as
\[E_{n}^{S}=-\frac{(b-a)^{5}}{2880n^{4}}\cdot f^{(4)}(c),\]
where \(c\in [a,b]\). In addition, if we assume that \(f^{(4)}(x)\) is bounded on \([a,b]\), say \(|f^{(4)}(x)|\leq M\) for \(a\leq x\leq b\), then
\[|E_{n}^{S}|\leq\frac{(b-a)^{5}}{2880n^{4}}M.\]
For example, to achieve four-decimal-place accuracy in estimating
\[\ln 2=\int_{1}^{2}\frac{dx}{x}\]
using the Simpson’s rule, we try to find \(n\) satisfying
\[|E_{n}^{S}|\leq\frac{(2-1)^{5}}{2880n^{4}}M=\frac{M}{2880n^{4}}\leq 0.00005,\]
where \(M\) is a bound for \(|f^{(4)}(x)|=24/x^{5}\) on \([1,2]\). Clearly, we have \(|f^{(4)}(x)|\leq 24\) on \([1,2]\). Therefore, we want to find \(n\) satisfying
\[\frac{24}{2880n^{4}}=\frac{1}{120n^{4}}<0.00005.\]
This is equivalent to \(n^{4}>167\). We can verify that \(n=4\) is the smallest positive integer satisfies the above inequality. Obviously, this is a considerable improvement in efficiency over the trapezoidal rule.


