Section 2.4 Integration by Parts
¶We have already seen in Section 2.2.2 that recognizing the Product Rule can be useful, when we noticed that
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 called Integration by Parts.
Start with the Product Rule:
We can apply integration to this equation and obtain
and then rewrite this as
This may not seem particularly useful at first glance, but it turns out that in many cases we have an integral of the form
but that
is easier to integrate.
This technique for turning one integral into another is called Integration by Parts, and is usually written in more compact form.
Theorem 2.31. Integration by Parts.
Let \(u\) and \(v\) be differentiable functions, then
where
Note:
To use this technique we need to identify likely candidates for \(u=f(x)\) and \(dv=g'(x)\,dx\text{.}\) When choosing \(u\) and \(dv\text{,}\) keep in mind that we need to be able to readily find an antiderivative for \(dv\) and that \(du\) becomes simpler than \(u\text{.}\) Simpler could mean the power is reduced by one degree, or the original integral appears on the right side, or ...
-
After we have applied Integration by Parts, we then need to integrate \(\ds \int v\,du\text{.}\) There is a danger to fall into a circular trap by choosing as the part to integrate (\(v\)) the term in the differential (\(du\)) from the first application of Integration by Parts. This does not provide you with any new information, but instead brings you back to the original integral. For example: To evaluate \(\ds \int x^2\sin x\,dx\) we choose
\begin{equation*} u=x^2 \text{ and } v=\sin x\,dx \text{ so that } du=2x\,dx \text{ and } dv=-\cos x\,dx\text{,} \end{equation*}then
\begin{equation*} \int x^2\sin x\,dx = -x^2\cos x + 2\int x\cos x\,dx\text{.} \end{equation*}If we ignore that the new integral is simpler than the original integral, which would tell us to continue in the same manner of selecting \(u\) and \(dv\text{,}\) we may fall into the circular trap of choosing
\begin{equation*} u=\cos x \text{ and } v=x\,dx \text{ so that } du=-\sin x\,dx \text{ and } dv=\frac{x^2}{2}\,dx\text{,} \end{equation*}so that
\begin{equation*} \begin{split} \int x^2\sin x\,dx \amp = -x^2\cos x + 2\int x\cos x\,dx \\ \amp = -x^2\cos x + 2\left(\cos x \frac{x^2}{2} + \int \frac{x^2}{2}\sin x\,dx\right) \\ \amp = \int x^2 \sin x\,dx. \end{split} \end{equation*}This shows that with our carelessness we have wasted our time and are back at the beginning.
Example 2.32. Product of a Linear Function and Logarithm.
Evaluate \(\ds\int x\ln x\,dx\text{.}\)
Let \(u=\ln x\) so \(du=1/x\,dx\text{.}\) Then we must let \(dv=x\,dx\) so \(\ds v=x^2/2\) and
Example 2.33. Inverse Trigonometric Function.
Evaluate \(\ds\int \sin^{-1} x \, dx\text{.}\)
Let \(u=\sin^{-1} x\) so
Then we must let \(dv=\,dx\) so \(v=x\text{.}\) Therefore,
Now use substitution with \(u = 1-x^2\) and \(du = -2x\, dx\text{.}\) Then
Altogether, we find that
Example 2.34. Secant Cubed (again).
Evaluate \(\ds\int\sec^3 x\,dx\text{.}\)
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 \(\ds dv=\sec^2 x\,dx\text{.}\) Then \(du=\sec x\tan x\) and \(v=\tan x\) and
At first this looks useless—we're right back to \(\ds \int\sec^3x\,dx\text{.}\) But looking more closely, we notice that we can add this integral to both sides and are left to deal with the integral \(\ds \int \sec x\,dx\text{.}\)
Now we use our knowledge of \(\ds\int \sec x\,dx\) to conclude that
Example 2.35. Product of a Polynomial and Trigonometric Function.
Evaluate \(\ds\int x^2\sin x\,dx\text{.}\)
Let \(u=x^2\text{,}\) \(dv=\sin x\,dx\text{;}\) then \(du=2x\,dx\) and \(v=-\cos x\text{.}\) Now
This is better than the original integral since the power of \(x\) has been reduced by one degree, but we need to do Integration by Parts again. Let \(u=2x\text{,}\) \(dv=\cos x\,dx\text{;}\) then \(du=2\) and \(v=\sin x\text{,}\) and
Subsection 2.4.1 Tabular Method
¶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:
To form this 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.
Alternatively, we can use the following table:
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 \(\ds -x^2\cos x\text{,}\) and add this to the integral of the product of the second entry in column \(u\) and second entry in column \(dv\text{.}\) This gives:
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, \(\ds (x^2)(-\cos x)\) and \((-2x)(-\sin x)\) and then once straight across, \((2)(-\sin x)\text{,}\) and combine these as
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 \(\ds (x^2)(-\cos x)\text{,}\) \((-2x)(-\sin x)\text{,}\) and \((2)(\cos x)\text{,}\) and once straight across, \((0)(\cos x)\text{.}\) We combine these as before to get
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.
Exercises for Section 2.4.
Exercise 2.4.1.
Evaluate the following indefinite integrals. Hint
-
\(\ds\int xe^{x^2}\,dx\)
AnswerSolution\(\ds (1/2)e^{x^2} +C\)We will solve this integral using a simple substitution:
\begin{equation*} u = x^2, \text{ with } du = 2x\,dx\text{.} \end{equation*}Then:
\begin{equation*} \begin{split} \int x e^{x^2}\,dx \amp = \frac{1}{2}\int e^u\,du\\ \amp = \frac{1}{2} e^u + C\\ \amp = \frac{1}{2} e^{x^2} + C. \end{split} \end{equation*} -
\(\ds\int \sin^2 x\,dx\)
AnswerSolution\((x/2)-\sin(2x)/4 +C=\)\((x/2)-(\sin x\cos x)/2+C\)We will solve using integration by parts (although this integral is more easily solved using a trigonometric identity). Take
\begin{equation*} \begin{array}{cc} u = \sin x \amp dv = \sin x \,dx \\ du = \cos x \, dx \amp v = -\cos x \end{array} \end{equation*}Therefore,
\begin{equation*} \int \sin^2x \, dx = -\sin x \cos x + \int \cos^2 x \, dx\text{.} \end{equation*}Now, let \(\cos^2x = 1-\sin^2 x\text{.}\) Thus,
\begin{equation*} \begin{split} \int \sin^2 x \, dx \amp = -\sin x \cos x + \int \left(1-\sin^2 x\right) \, dx \\ 2 \int \sin ^2 x \, dx \amp = -\sin x \cos x + x + C \\ \int \sin ^2 x \, dx \amp = -\frac{1}{2}\sin x \cos x + \frac{x}{2} + \hat{C}. \end{split} \end{equation*} -
\(\ds\int x\arctan x\,dx\)
AnswerSolution\(\ds (x^2\arctan x +\arctan x -x)/2+C\)Recall that \(\diff{}{x} \arctan x = \frac{1}{x^2+1}\text{.}\) We will solve this integral using integration by parts, with
\begin{equation*} \begin{array}{cc} u = \arctan x \amp dv = x \,dx \\ du = \frac{1}{x^2+1} \, dx \amp v = \frac{x^2}{2} \end{array} \end{equation*}Therefore,
\begin{equation*} \int x\arctan x \,dx = \frac{x^2\arctan x}{2} - \frac{1}{2}\int \frac{x^2}{x^2+1} \,dx\text{.} \end{equation*}Now, rewrite
\begin{equation*} \frac{x^2}{x^2+1} = 1 - \frac{1}{x^2+1}\text{.} \end{equation*}Then:
\begin{equation*} \begin{split} \int x\arctan x \,dx \amp = \frac{x^2\arctan x}{2} - \frac{1}{2} \int \,dx + \frac{1}{2}\int \frac{1}{x^2+1}\,dx \\ \amp = \frac{x^2\arctan x}{2} - \frac{x}{2} +\frac{1}{2}\arctan x +C \end{split} \end{equation*} -
\(\ds\int x\sin^2 x\,dx\)
AnswerSolution\(\ds x^2/4-(\cos^2 x)/4-(x\sin x\cos x)/2+C\)We rewrite the integrand:
\begin{equation*} \int x\sin^2 x \,dx =\int \frac{x}{2}\left(1-\cos(2x)\right) = \frac{1}{2}\int x\,dx-\frac{1}{2} \int x \cos (2x)\,dx\text{.} \end{equation*}Now, use the method of integration by parts with
\begin{equation*} \begin{array}{cc} u = x \amp dv = \cos 2x \,dx \\ du = dx \amp v = \frac{1}{2}\sin(2x) \end{array} \end{equation*}Therefore,
\begin{equation*} \begin{split} \int x\sin^2 x \,dx \amp = \frac{1}{4} x^2 - \frac{1}{4} x \sin(2x) + \frac{1}{4} \int \sin(2x)\,dx\\ \amp = \frac{1}{4} x^2 - \frac{1}{4} x \sin(2x) + \frac{1}{8} \cos(2x) + C \end{split} \end{equation*} -
\(\ds\int x\sin x\cos x\,dx\)
AnswerSolution\(\ds x/4-(x\cos^2 x)/2+(\cos x\sin x)/4+C\)Recall that \(2\sin x \cos x = \sin(2x)\text{.}\) Then
\begin{equation*} \int x\sin x \cos x \, dx = \frac{1}{2}\int x\sin(2x)\,dx\text{.} \end{equation*}We use the method of integration by parts with
\begin{equation*} \begin{array}{cc} u = x \amp dv = \sin(2x) \,dx \\ du = \,dx \amp v = -\frac{\cos(2x)}{2} \end{array} \end{equation*}This gives
\begin{equation*} \begin{split} \int x\sin x \cos x \, dx \amp = \frac{1}{2}\int x\sin(2x)\,dx\\ \amp = -\frac{x}{4} \cos(2x) + \frac{1}{4}\int \cos(2x)\,dx\\ \amp = -\frac{x}{4} \cos(2x) + \frac{1}{8}\sin(2x) + C \end{split} \end{equation*}
Exercise 2.4.2.
Evaluate the following indefinite integrals.
-
\(\ds\int x\cos x\,dx\)
AnswerSolution\(\cos x+x\sin x+C\)We use the method of integration by parts: Let
\begin{equation*} \begin{array}{cc} u = x \amp dv = \cos x\,dx \\ du = \, dx \amp v = \sin x \end{array} \end{equation*}This gives
\begin{equation*} \begin{split} \int x\cos x\,dx \amp = x\sin x - \int \sin x\,dx \\ \amp = x\sin x + \cos x + C. \end{split} \end{equation*} -
\(\ds\int x^2\cos x\,dx\)
AnswerSolution\(\ds x^2\sin x-2 \sin x+2x\cos x +C\)Solve using integration by parts: Let
\begin{equation*} \begin{array}{cc} u = x^2 \amp dv = \cos x\,dx \\ du = 2x \, dx \amp v = \sin x \end{array} \end{equation*}So,
\begin{equation*} \int x^2 \cos x \, dx = x^2\sin x - 2\int x \sin x \, dx\text{.} \end{equation*}Now to evaluate the second integral, take
\begin{equation*} \begin{array}{cc} u = x \amp dv = \sin x\,dx\\ du = dx \amp v = -\cos x \end{array} \end{equation*}Thus,
\begin{equation*} \int x \sin x \, dx = -x\cos x + \int \cos x \, dx = -x\cos x + \sin x + C\text{.} \end{equation*}All together, we have that
\begin{equation*} \int x^2 \cos x \, dx = x^2\sin x + 2x\cos x - 2\sin x + \hat{C}\text{.} \end{equation*} -
\(\ds\int xe^x\,dx\)
AnswerSolution\(\ds (x-1)e^x +C\)Take
\begin{equation*} \begin{array}{cc} u = x \amp dv = e^x\,dx \\ du = \,dx \amp v = e^x \end{array} \end{equation*}Therefore,
\begin{equation*} \begin{split} \int xe^x\,dx \amp = xe^x - \int e^x \, dx \\ \amp = xe^x - e^x + C. \end{split} \end{equation*} -
\(\ds\int \ln x\,dx\)
AnswerSolution\(x\ln x-x +C\)Let
\begin{equation*} \begin{array}{cc} u = \ln x \amp dv = dx \\ du = \frac{1}{x}\,dx \amp v = x \end{array} \end{equation*}Then,
\begin{equation*} \begin{split} \int \ln x \,dx \amp = x\ln x - \int \frac{x}{x}\,dx \\ \amp = x\ln x - x + C. \end{split} \end{equation*} -
\(\ds\int x^3\sin x\,dx\)
AnswerSolution\(\ds -x^3\cos x+3x^2\sin x+6x\cos x-6\sin x+C\)We use the method of integration by parts. First, let
\begin{equation*} \begin{array}{cc} u = x^3 \amp dv = \sin x\,dx \\ du = 3x^2 \, dx \amp v = -\cos x \end{array} \end{equation*}Then
\begin{equation*} \int x^3\sin x \,dx = -x^3\cos x + 3\int x^2 \cos x \,dx\text{.} \end{equation*}To solve the second integral, we will use integration by parts again with:
\begin{equation*} \begin{array}{cc} u = x^2 \amp dv = \cos x\,dx \\ du = 2x \, dx \amp v = \sin x \end{array} \end{equation*}So,
\begin{equation*} \int x^2 \cos x \, dx = x^2\sin x - 2\int x \sin x \, dx\text{.} \end{equation*}Now apply integration by parts a third time with
\begin{equation*} \begin{array}{cc} u = x \amp dv = \sin x\,dx\\ du = dx \amp v = -\cos x \end{array} \end{equation*}Thus,
\begin{equation*} \int x \sin x \, dx = -x\cos x + \int \cos x \, dx = -x\cos x + \sin x + C\text{.} \end{equation*}All together, we have that
\begin{equation*} \int x^3\sin x \, dx = -x^3\cos x + 3x^2\sin x + 6x\cos x -6 \sin x + C\text{.} \end{equation*} -
\(\ds\int x^3\cos x\,dx\)
AnswerSolution\(\ds x^3\sin x+3x^2\cos x-6x\sin x -6\cos x+C\)We use the method of integration by parts. First, let
\begin{equation*} \begin{array}{cc} u = x^3 \amp dv = \cos x\,dx \\ du = 3x^2 \, dx \amp v = \sin x \end{array} \end{equation*}Therefore, we have
\begin{equation*} \int x^3\cos x \,dx = x^3\sin x - 3\int x^2\sin x\,dx\text{.} \end{equation*}Now use integration by parts again with
\begin{equation*} \begin{array}{cc} u = x^2 \amp dv = \sin x\,dx \\ du = 2x \, dx \amp v = -\cos x \end{array} \end{equation*}Now we have
\begin{equation*} \begin{split} \int x^3\cos x \,dx \amp = x^3\sin x - 3\left(-x^2\cos x + 2\int x\cos x\,dx\right) \\ \amp = x^3\sin x +3 x^2\cos x - 6 \int x \cos x \,dx \end{split} \end{equation*}We will need to use integration by parts a third time, with
\begin{equation*} \begin{array}{cc} u = x \amp dv = \cos x\,dx \\ du = \, dx \amp v = \sin x \end{array} \end{equation*}This gives us
\begin{equation*} \begin{split} \int x^3\cos x \,dx \amp = x^3\sin x +3 x^2\cos x - 6 \int x \cos x \,dx \\ \amp = x^3\sin x +3 x^2\cos x - 6\left(x\sin x - \int \sin x\right)\\ \amp = x^3\sin x +3 x^2\cos x - 6x\sin x - 6\cos x + C. \end{split} \end{equation*} -
\(\ds\int \arctan(\sqrt x)\,dx\)
AnswerSolution\(x\arctan(\sqrt x)+\arctan(\sqrt x)-\sqrt{x}+C\)Recall that
\begin{equation*} \diff{}{x} \arctan(\sqrt{x}) = \frac{1}{1+x} \cdot \frac{1}{2\sqrt{x}}\text{.} \end{equation*}Now let
\begin{equation*} \begin{array}{cc} u = \arctan(\sqrt{x}) \amp dv = \,dx \\ du = \frac{1}{2\sqrt{x}(x+1)}\, dx \amp v = x \end{array} \end{equation*}This gives
\begin{equation*} \begin{split} \int \arctan(\sqrt{x})\,dx \amp = x\arctan(\sqrt{x}) - \int \frac{x}{2\sqrt{x}(x+1)}\,dx\\ \amp = x\arctan(\sqrt{x}) - \frac{1}{2} \int \frac{\sqrt{x}}{x+1}\,dx \end{split} \end{equation*}To solve the second integral, make the substitution \(u = \sqrt{x}\text{:}\) (
\begin{equation*} \begin{split} \int \frac{\sqrt{x}}{x+1}\,dx \amp = 2 \int \frac{u^2}{u^2+1}\,du \\ \amp = 2 \int \,du - 2\int \frac{1}{u^2+1}\,du \\ \amp = 2u - 2 \arctan(u) + C\\ \amp = 2\sqrt{x} - 2\arctan(\sqrt{x} + C \end{split} \end{equation*}All together, we have:
\begin{equation*} \int \arctan(\sqrt{x})\,dx = x\arctan(\sqrt{x}) - \sqrt{x} + \arctan(\sqrt{x}) + C\text{.} \end{equation*} -
\(\ds\int \sin(\sqrt x)\,dx\)
AnswerSolution\(2\sin(\sqrt x)-2\sqrt x\cos(\sqrt x)+C\)First, use the subsititution \(\theta=\sqrt{x}\) with \(d\theta = \frac{1}{2\sqrt{x}}\,dx\text{.}\) This gives
\begin{equation*} \int \sin(\sqrt{x})\,dx = \int \sin\theta \cdot 2\theta \,d\theta = 2\int \theta \sin\theta \,d\theta\text{.} \end{equation*}We now try to integrate by parts with
\begin{equation*} \begin{array}{cc} u = \theta \amp dv = \sin\,d\theta \\ du = d\theta \amp v = -\cos\theta \end{array} \end{equation*}Therefore, we have
\begin{equation*} \begin{split} \int \theta \sin\theta \,d\theta \amp = -\theta\cos\theta + \int \cos \theta \,d\theta \\ \amp = -\theta\cos\theta + \sin \theta \end{split} \end{equation*}Returning to the \(x\) variable, we find
\begin{equation*} \int \sin(\sqrt{x})\,dx = 2\left(-\sqrt{x} \cos(\sqrt{x}) + \sin(\sqrt{x})\right) + C\text{.} \end{equation*} -
\(\ds\int\sec^2 x\csc^2 x\,dx\)
AnswerSolution\(\sec x\csc x-2\cot x+C\)We recall that
\begin{equation*} int \sec^2 x \,dx = \tan x\text{,} \end{equation*}and so let's try taking
\begin{equation*} \begin{array}{cc} u = \csc^2 x \amp dv = \sec^2 x\,dx \\ du = -2\csc^2 x \cot x \amp v = \tan x \end{array} \end{equation*}This gives
\begin{equation*} \begin{split} \int \sec^2 x \csc^2 x\,dx \amp = \tan x \csc^2x + 2 \int \tan x \csc^2 x \cot x \,dx\\ \amp = \tan x \csc^2x + 2 \int \csc^2 x\,dx\\ \amp = \tan x \csc^2x - 2 \cot x + C\\ \amp = \sec x \csc x - 2 \cot x + C \end{split} \end{equation*}