The sum rule for derivatives is simple enough that it leads directly to the first statement of Proposition 11.2, which is an identical rule for anti-derivatives. There is also a product rule, but it does not lead directly to an identical rule for anti-derivatives. That’s because the product rule for derivatives is not symmetric. The derivative of \(fg\) is not \(f' g'\) but rather \(f'g + g'f\text{.}\) When we run the product rule backwards, we get
The problem is, this doesn’t tell us how to integrate a product such as \(f' g'\text{!}\)(11.1) is great if someone asks us to compute the anti-derivative of \(f'g + g'f\text{,}\) but this is rare, harder to spot, and does not answer the question as to the anti-derivative of a product.
Let \(u\) and \(v\) be differentiable functions. Suppose \(u' v\) is known to have anti-derivative \(G\text{.}\) Then \(v' u\) has anti-derivative \(u v - G\text{.}\) In a single equation,
\begin{equation}
\displaystyle\int v' u \, dx = uv - \displaystyle\int u' v \, dx \, .\tag{11.2}
\end{equation}
The way this works in practice is that when integrating an expression, you try to identify the expression as \(v' u\) for some functions \(u\) and \(v\text{.}\) Then you check whether you already know the anti-derivative to \(u' v\text{.}\) If so, you subtract this from \(uv\) and you are done. Sometimes there are several possible ways to do this, in which case you may have to try them all until you find one that works.
Obviously this decomposes as a product of \(x\) and \(e^x\text{.}\) One of these should be \(v'\) and the other should be \(u\text{.}\) Let’s try setting
\begin{align*}
v' & = x \, ;\\
u & = e^x \,
\end{align*}
At first this goes smoothly: the expression we chose for \(v\) has a known anti-derivative and the one we chose for \(u\) has a known derivative, therefore we can find \(v\) and \(u'\text{:}\)
\begin{align*}
v & = \frac{x^2}{2} + C \, ;\\
u' & = e^x \,
\end{align*}
Unfortunately the next step doesn’t work: \(u' v = e^x (x^2/2 + C)\text{,}\) which is not something whose anti-derivative we recognize no matter what choice we make for the constant \(C\text{.}\)
Again it goes smoothly at first: the expression we chose for \(v\) has a known integral \(e^x\) and the one we chose for \(u\) has a known derivative \(1\text{,}\) therefore
\begin{align*}
v & = e^x + C \, ;\\
u' & = 1 \,
\end{align*}
Now we’re in better shape. Choose \(C=0\) (usually this works if anything does). Then \(u'v = e^x\text{,}\) for which an integral is known, namely \(e^x\text{.}\) Therefore,
\begin{equation*}
\displaystyle\int x e^x \, dx = \displaystyle\int u v' \, dx = uv - \displaystyle\int u' v \, dx
= x e^x - \displaystyle\int e^x \, dx = x e^x - e^x + C \, .
\end{equation*}
We did a long-winded example to show you the process of trial and error and to show how each step works. What would have happened if we chose a different value of \(C\text{?}\) It turns out it always works exactly as well.
It usually takes several worked examples and a lot of practice before integration by parts feels natural. Because "a lot of practice" means different things to different people, we include only a few mandatory self-check and howework problems, putting a greater number online for those who want to practice.
We start with the indefinite integral, which we compute by parts. Based on what happened with \(x e^x\text{,}\) let’s decide to start with the choice \(u = x, v' = \sin x\text{.}\) Then \(v = - \cos x\) and \(u' = 1\text{,}\) which yields
\begin{equation*}
\displaystyle\int x \sin(x) \, dx = - x \cos x - \displaystyle\int (- \cos x) \, dx
= - x \cos x - (- \sin x) = \sin x - x \cos x + C \, .
\end{equation*}
Evaluating the definite integral (notice we chose \(C=0\)),
Here are a few more tips to help you use integration by parts. Also, you should see a notational variation that is common in textbooks and on the web. Instead of \(\displaystyle\int v' u \, dx =
uv - \displaystyle\int u' v \, dx\text{,}\) people sometimes write
\begin{equation*}
\displaystyle\int u \, dv = uv - \displaystyle\int v \, du \, .
\end{equation*}
Because \(u\) and \(v\) are functions of \(x\text{,}\) you can think of \(du := u'(x) \, dx\) and \(dv := v' (x) \, dx\text{,}\) whereby this form of the identity comes out to exactly the same thing as (11.2)
Sometimes integration by parts doesn’t quite get you to an expression \(u'v\) that you know how to evaluate, but it gets you closer, so that repeating the integration by parts solves the problem.
That last expression isn’t covered by Proposition 11.1 but we just saw (take out the constant factor 2) that it can be done by parts and integrates to \(2 (x e^x - e^x) = 2 (x-1) e^x\text{.}\) Therefore,
It should be apparent you can integrate \(p(x) e^x\) this way for any polynomial \(p\text{.}\) Some textbooks have a separate algorithm for this called tabular integration. We won’t be teaching that, but you can google it if you ever need the anti-derivative of \(p(x) e^x\) where \(p(x)\) has degree more than, say, 3 (doing it by hand gets longer and more complicated as the degree of \(p\) grows). To see how this will go, try the following exercise, which is about as much as we would ever ask you to do by hand.
You can always decompose any expression as itself times 1. In the langauge of \(v \, du\) and \(u \, dv\text{,}\) that says \(\displaystyle\int f (x) \, dx\) can always be thought of as \(u \, dv\) where \(u(x) = f(x)\) and \(dv = dx\text{,}\) that is, \(v' = 1\text{.}\) This only sometimes works but it’s good to know.
There’s only one term to decompose so we pretty much have to use the \(dv = dx\) trick. Setting \(u(x) = \ln x\) and \(dv = dx\text{,}\) gives (recalling that the derivatve of \(\ln x\) is \(1/x\)),
\begin{equation*}
\displaystyle\int \ln (x) \, dx = (\ln x) (x) - \displaystyle\int x \cdot \frac{1}{x} \, dx =
x \ln x - \displaystyle\int 1 \cdot dx = x \ln x - x + C \, .
\end{equation*}
This is a good one to memorize - it’s very useful to recall quickly how to integrate the natural log.