8.5: Integration by Parts
- Page ID
- 915
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)We have already seen that recognizing the product rule can be useful, when we noticed that
\[\int \sec^3u+\sec u \tan^2u\,du=\sec u \tan u.\]
As with substitution, we do not have to rely on insight or cleverness to discover such antiderivatives; there is a technique that will often help to uncover the product rule.
Start with the product rule:
\[{d\over dx}f(x)g(x)=f'(x)g(x)+f(x)g'(x).\]
We can rewrite this as
\[f(x)g(x)=\int f'(x)g(x)\,dx +\int f(x)g'(x)\,dx,\]
and then
\[\int f(x)g'(x)\,dx=f(x)g(x)-\int f'(x)g(x)\,dx.\]
This may not seem particularly useful at first glance, but it turns out that in many cases we have an integral of the form
\[\int f(x)g'(x)\,dx\]
but that
\[\int f'(x)g(x)\,dx\]
is easier. This technique for turning one integral into another is called integration by parts, and is usually written in more compact form. If we let \(u=f(x)\) and \(v=g(x)\) then \(du=f'(x)\,dx\) and \(dv=g'(x)\,dx\) and
\[\int u\,dv = uv-\int v\,du.\]
To use this technique we need to identify likely candidates for \(u=f(x)\) and \(dv=g'(x)\,dx\).
Example \(\PageIndex{1}\)
Evaluate \(\displaystyle \int x\ln x\,dx\).
Solution
Let \(u=\ln x\) so \(du=1/x\,dx\). Then we must let \(dv=x\,dx\) so \( v=x^2/2\) and
\[ \int x\ln x\,dx={x^2\ln x\over 2}-\int {x^2\over2}{1\over x}\,dx= {x^2\ln x\over 2}-\int {x\over2}\,dx={x^2\ln x\over 2}-{x^2\over4}+C. \]
Example \(\PageIndex{2}\)
Evaluate \(\displaystyle \int x\sin x\,dx\).
Solution
Let \(u=x\) so \(du=dx\). Then we must let \(dv=\sin x\,dx\) so \(v=-\cos x\) and
\[\int x\sin x\,dx=-x\cos x-\int -\cos x\,dx= -x\cos x+\int \cos x\,dx=-x\cos x+\sin x+C.\]
Example \(\PageIndex{3}\)
Evaluate \(\displaystyle \int\sec^3 x\,dx\).
Solution
Of course we already know the answer to this, but we needed to be clever to discover it. Here we'll use the new technique to discover the antiderivative. Let \(u=\sec x\) and \( dv=\sec^2 x\,dx\). Then \(du=\sec x\tan x\,dx\) and \(v=\tan x\) and
\[\eqalign{ \int\sec^3 x\,dx&=\sec x\tan x-\int \tan^2x\sec x\,dx\cr &=\sec x\tan x-\int (\sec^2x-1)\sec x\,dx\cr &=\sec x\tan x-\int \sec^3x\,dx +\int\sec x\,dx.\cr }\]
At first this looks useless---we're right back to \( \int\sec^3x\,dx\). But looking more closely:
\[\eqalign{ \int\sec^3x\,dx&=\sec x\tan x-\int \sec^3x\,dx +\int\sec x\,dx\cr \int\sec^3x\,dx+\int \sec^3x\,dx&=\sec x\tan x +\int\sec x\,dx\cr 2\int\sec^3x\,dx&=\sec x\tan x +\int\sec x\,dx\cr \int\sec^3x\,dx&={\sec x\tan x\over2} +{1\over2}\int\sec x\,dx\cr &={\sec x\tan x\over2} +{\ln|\sec x+\tan x|\over2}+C.\cr }\]
Example \(\PageIndex{4}\)
Evaluate \( \displaystyle \int x^2\sin x\,dx\).
Solution
Let \(u=x^2\), \(dv=\sin x\,dx\); then \(du=2x\,dx\) and \(v=-\cos x\). Now \( \int x^2\sin x\,dx=-x^2\cos x+\int 2x\cos x\,dx\). This is better than the original integral, but we need to do integration by parts again. Let \(u=2x\), \(dv=\cos x\,dx\); then \(du=2\) and \(v=\sin x\), and
\[\eqalign{ \int x^2\sin x\,dx&=-x^2\cos x+\int 2x\cos x\,dx\cr &=-x^2\cos x+ 2x\sin x - \int 2\sin x\,dx\cr &=-x^2\cos x+ 2x\sin x + 2\cos x + C.\cr }\]
Such repeated use of integration by parts is fairly common, but it can be a bit tedious to accomplish, and it is easy to make errors, especially sign errors involving the subtraction in the formula. There is a nice tabular method to accomplish the calculation that minimizes the chance for error and speeds up the whole process. We illustrate with the previous example. Here is the table:
|
or |
|
To form the first table, we start with \(u\) at the top of the second column and repeatedly compute the derivative; starting with \(dv\) at the top of the third column, we repeatedly compute the antiderivative. In the first column, we place a "\(-\)'' in every second row. To form the second table we combine the first and second columns by ignoring the boundary; if you do this by hand, you may simply start with two columns and add a "\(-\)'' to every second row.
To compute with this second table we begin at the top. Multiply the first entry in column \(u\) by the second entry in column \(dv\) to get \( -x^2\cos x\), and add this to the integral of the product of the second entry in column \(u\) and second entry in column \(dv\). This gives:
\[-x^2\cos x+\int 2x\cos x\,dx,\]
or exactly the result of the first application of integration by parts. Since this integral is not yet easy, we return to the table. Now we multiply twice on the diagonal, \( (x^2)(-\cos x)\) and \((-2x)(-\sin x)\) and then once straight across, \((2)(-\sin x)\), and combine these as
\[-x^2\cos x+2x\sin x-\int 2\sin x\,dx,\]
giving the same result as the second application of integration by parts. While this integral is easy, we may return yet once more to the table. Now multiply three times on the diagonal to get \( (x^2)(-\cos x)\), \((-2x)(-\sin x)\), and \((2)(\cos x)\), and once straight across, \((0)(\cos x)\). We combine these as before to get
\[ -x^2\cos x+2x\sin x +2\cos x+\int 0\,dx= -x^2\cos x+2x\sin x +2\cos x+C. \]
Typically we would fill in the table one line at a time, until the "straight across'' multiplication gives an easy integral. If we can see that the \(u\) column will eventually become zero, we can instead fill in the whole table; computing the products as indicated will then give the entire integral, including the "\(+C\,\)'', as above.
Contributors
Integrated by Justin Marshall.