\begin{align*}
\int \big[u'(x)\,v(x)+u(x)\,v'(x)\big]\dee{x}
&=\big[\text{a function whose derivative is $u'v+uv'$}\big] + C\\
&=u(x)v(x) +C
\end{align*}
Now this, by itself, is not terribly useful. In order to apply it we need to have a function whose integrand is a sum of products that is in exactly this form \(u'(x)v(x) + u(x)v'(x)\text{.}\) This is far too specialised.
In this form we take the integral of one product and express it in terms of the integral of a different product. If we express it like that, it doesn’t seem too useful. However, if the second integral is easier, then this process helps us.
Let us do a simple example before explaining this more generally.
Example1.7.1.\(\int xe^x \dee{x}\).
Compute the integral \(\ds \int xe^x \dee{x}\text{.}\)
Now set \(u(x)=x\) and \(v'(x)=e^x\text{.}\) How did we know how to make this choice? We will explain some strategies later. For now, let us just accept this choice and keep going.
In order to use the formula we need to know \(u'(x)\) and \(v(x)\text{.}\) In this case it is quite straightforward: \(u'(x)=1\) and \(v(x)=e^x\text{.}\)
Plug everything into the formula:
\begin{align*}
\int x e^x \dee{x} &= x e^x - \int e^x \dee{x}\\
\end{align*}
So our original more difficult integral has been turned into a question of computing an easy one.
The process we have used in the above example is called “integration by parts”. When our integrand is a product we try to write it as \(u(x) v'(x)\) — we need to choose one factor to be \(u(x)\) and the other to be \(v'(x)\text{.}\) We then compute \(u'(x)\) and \(v(x)\) and then apply the following theorem:
Theorem1.7.2.Integration by parts.
Let \(u(x)\) and \(v(x)\) be continuously differentiable. Then
Integration by parts is not as easy to apply as the product rule for derivatives. This is because it relies on us
judiciously choosing \(u(x)\) and \(v'(x)\text{,}\) then
computing \(u'(x)\) and \(v(x)\) — which requires us to antidifferentiate \(v'(x)\text{,}\) and finally
that the integral \(\int u'(x) v(x)\dee{x}\) is easier than the integral we started with.
Notice that any antiderivative of \(v'(x)\) will do. All antiderivatives of \(v'(x)\) are of the form \(v(x)+A\) with \(A\) a constant. Putting this into the integration by parts formula gives
In most applications (but not all) our integrand will be a product of two factors so we have two choices for \(u(x)\) and \(v'(x)\text{.}\) Typically one of these choices will be “good” (in that it results in a simpler integral) while the other will be “bad” (we cannot antidifferentiate our choice of \(v'(x)\) or the resulting integral is harder). Let us illustrate what we mean by returning to our previous example.
Example1.7.3.\(\int xe^x \dee{x}\) — again.
Our integrand is the product of two factors
\begin{align*}
x && \text{and} && e^x
\end{align*}
This gives us two obvious choices of \(u\) and \(v'\text{:}\)
The above reasoning is a very typical workflow when using integration by parts.
Integration by parts is often used
to eliminate factors of \(x\) from an integrand like \(xe^x\) by using that \(\diff{}{x}x=1\) and
to eliminate a \(\log x\) from an integrand by using that \(\diff{}{x}\log x=\frac{1}{x}\) and
to eliminate inverse trig functions, like \(\arctan x\text{,}\) from an integrand by using that, for example, \(\diff{}{x}\arctan x=\frac{1}{1+x^2}\text{.}\)
Example1.7.4.\(\int x\sin x\dee{x}\).
Solution:
Again we have a product of two factors giving us two possible choices.
If we choose \(u(x)=x\) and \(v'(x)=\sin x\text{,}\) then we get
\begin{align*}
u'(x) &=1 &\text{and} && v(x) &= -\cos x
\end{align*}
which is looking promising.
On the other hand if we choose \(u(x)=\sin x\) and \(v'(x)=x\text{,}\) then we have
\begin{align*}
u'(x)&=\cos x &\text{and} && v(x) &= \frac{1}{2}x^2
\end{align*}
which is looking worse — we’d need to integrate \(\int \frac{1}{2}x^2 \cos x \dee{x}\text{.}\)
So we stick with the first choice. Plugging \(u(x)=x\text{,}\)\(v(x)=-\cos x\) into integration by parts gives us
\begin{align*}
\int x \sin x \dee{x} &= -x\cos x - \int 1 \cdot (-\cos x) \dee{x}\\
&= -x\cos x + \sin x + C
\end{align*}
Again we can check our answer by differentiating:
\begin{align*}
\diff{}{x}\left( -x\cos x + \sin x + C \right)
&= -\cos x + x\sin x + \cos x + 0\\
&= x \sin x \checkmark
\end{align*}
Once we have practised this a bit we do not really need to write as much. Let us solve it again, but showing only what we need to.
Solution:
We use integration by parts to solve the integral.
Set \(u(x)=x\) and \(v'(x)=\sin x\text{.}\) Then \(u'(x)=1\) and \(v(x)=-\cos x\text{,}\) and
\begin{align*}
\int x \sin x \dee{x} &= -x\cos x + \int \cos x \dee{x}\\
&= -x\cos x + \sin x + C.
\end{align*}
It is pretty standard practice to reduce the notation even further in these problems. As noted above, many people write the integration by parts formula as
\begin{align*}
\int u\dee{v} &= uv - \int v \dee{u}
\end{align*}
where \(\dee{u}, \dee{v}\) are shorthand for \(u'(x)\dee{x}, v'(x)\dee{x}\text{.}\) Let us write up the previous example using this notation.
Example1.7.5.\(\int x\sin x\dee{x}\) yet again.
Solution: Using integration by parts, we set \(u=x\) and \(\dee{v}=\sin x\dee{x}\text{.}\) This makes \(\dee{u}= 1\dee{x}\) and \(v=-\cos x\text{.}\) Consequently
\begin{align*}
\int x \sin x \dee{x} &= \int u\dee{v}\\
&= uv - \int v\dee{u}\\
&= -x\cos x + \int \cos x \dee{x}\\
&= -x \cos x +\sin x + C
\end{align*}
You can see that this is a very neat way to write up these problems and we will continue using this shorthand in the examples that follow below.
We can also use integration by parts to eliminate higher powers of \(x\text{.}\) We just need to apply the method more than once.
Example1.7.6.\(\int x^2 e^x \dee{x}\).
Solution:
Let \(u=x^2\) and \(\dee{v}=e^x\dee{x}\text{.}\) This then gives \(\dee{u}=2x\dee{x}\) and \(v=e^x\text{,}\) and
So we have reduced the problem of computing the original integral to one of integrating \(2xe^x\text{.}\) We know how to do this — just integrate by parts again:
where \(P(x)\) is a polynomial and \(A,B,C,a,b,c\) are constants.
Now let us look at integrands containing logarithms. We don’t know the antiderivative of \(\log x\text{,}\) but we can eliminate \(\log x\) from an integrand by using integration by parts with \(u=\log x\text{.}\) Remember \(\log x = \log_e x = \ln x\text{.}\)
Example1.7.7.\(\int x\log x\dee{x}\).
Solution:
We have two choices for \(u\) and \(\dee{v}\text{.}\)
Set \(u=x\) and \(\dee{v}=\log x\dee{x}\text{.}\) This gives \(\dee{u}=\dee{x}\) but \(v\) is hard to compute — we haven’t done it yet 1
We will soon.
. Before we go further along this path, we should look to see what happens with the other choice.
Set \(u=\log x\) and \(\dee{v}=x\dee{x}\text{.}\) This gives \(\dee{u}=\frac{1}{x}\dee{x}\) and \(v=\frac{1}{2}x^2\text{,}\) and we have to integrate
\begin{align*}
\int x \log x \dee{x}
&= \frac{1}{2}x^2 \log x - \int \frac{1}{2} x \dee{x}\\
&= \frac{1}{2}x^2 \log x - \frac{1}{4}x^2 +C
\end{align*}
We can check our answer quickly:
\begin{align*}
\diff{}{x} \Big(\frac{x^2}{2} \ln x -\frac{x^2}{4} +C\Big)
&= x\,\ln x + \frac{x^2}{2}\,\frac{1}{x} -\frac{x}{2}+0
=x\,\ln x
\end{align*}
Example1.7.8.\(\int \log x\dee{x}\).
It is not immediately obvious that one should use integration by parts to compute the integral
\begin{gather*}
\int \log x \dee{x}
\end{gather*}
since the integrand is not a product. But we should persevere — indeed this is a situation where our shorter notation helps to clarify how to proceed.
Solution:
In the previous example we saw that we could remove the factor \(\log x\) by setting \(u=\log x\) and using integration by parts. Let us try repeating this. When we make this choice, we are then forced to take \(\dee{v}=\dee{x}\) — that is we choose \(v'(x)=1\text{.}\) Once we have made this sneaky move everything follows quite directly.
We then have \(\dee{u} = \frac{1}{x}\dee{x}\) and \(v = x\text{,}\) and the integration by parts formula gives us
\begin{align*}
\int \log x \dee{x}
&= x \log x - \int \frac{1}{x} \cdot x \dee{x}\\
&= x\log x - \int 1 \dee{x}\\
&= x \log x - x + C
\end{align*}
As always, it is a good idea to check our result by verifying that the derivative of the answer really is the integrand.
\begin{align*}
\diff{}{x} \big(x\ln x-x +C\big) &= \ln x + x\,\frac{1}{x} -1+0 =\ln x
\end{align*}
The same method works almost exactly to compute the antiderivatives of \(\arcsin(x)\) and \(\arctan(x)\text{:}\)
Example1.7.9.\(\int \arctan(x)\dee{x}\) and \(\int \arcsin(x)\dee{x}\).
Compute the antiderivatives of the inverse sine and inverse tangent functions.
Solution:
Again neither of these integrands are products, but that is no impediment. In both cases we set \(\dee{v}=\dee{x}\) (ie \(v'(x)=1\)) and choose \(v(x)=x\text{.}\)
For inverse tan we choose \(u=\arctan(x)\text{,}\) so \(\dee{u}=\frac{1}{1+x^2}\dee{x}\text{:}\)
\begin{align*}
\int \arctan(x) \dee{x}
&= x \arctan(x) - \int x \cdot \frac{1}{1+x^2} \dee{x}\\
\end{align*}
now use substitution rule with \(w(x)=1+x^2, w'(x)=2x\)
\begin{align*}
&= x \arctan(x) - \int \frac{w'(x)}{2} \cdot \frac{1}{w} \dee{x}\\
&= x \arctan(x) - \frac{1}{2} \int \frac{1}{w} \dee{w}\\
&= x \arctan(x) - \frac{1}{2}\log |w| + C\\
&= x \arctan(x) - \frac{1}{2} \log|1+x^2| + C \qquad \text{but $1+x^2 \gt 0$, so}\\
&= x \arctan(x) - \frac{1}{2} \log(1+x^2) + C
\end{align*}
Similarly for inverse sine we choose \(u=\arcsin(x)\) so \(\dee{u} = \frac{1}{\sqrt{1-x^2}}\dee{x}\text{:}\)
Both can be checked quite quickly by differentiating — but we leave that as an exercise for the reader.
There are many other examples we could do, but we’ll finish with a tricky one.
Example1.7.10.\(\int e^x \sin x\dee{x}\).
Solution: Let us attempt this one a little naively and then we’ll come back and do it more carefully (and successfully).
We can choose either \(u=e^x, \dee{v}=\sin x\dee{x}\) or the other way around.
Let \(u=e^x, \dee{v}=\sin x\dee{x}\text{.}\) Then \(\dee{u}=e^x\dee{x}\) and \(v=-\cos x\text{.}\) This gives
\begin{align*}
\int e^x \sin x &= -e^x\cos x + \int e^x \cos x \dee{x}
\end{align*}
So we are left with an integrand that is very similar to the one we started with. What about the other choice?
Let \(u=\sin x, \dee{v}=e^x\dee{x}\text{.}\) Then \(\dee{u}=\cos x\dee{x}\) and \(v= e^x\text{.}\) This gives
\begin{align*}
\int e^x \sin x &= e^x\sin x - \int e^x \cos x \dee{x}
\end{align*}
So we are again left with an integrand that is very similar to the one we started with.
How do we proceed? — It turns out to be easier if you do both \(\int e^x\sin x\dee{x}\) and \(\int e^x \cos x\dee{x}\) simultaneously. We do so in the next example.
Example1.7.11.\(\int_a^b e^x\sin x\dee{x}\) and \(\int_a^b e^x\cos x\dee{x}\).
Note that we can always check whether or not this is correct. It is correct if and only if the derivative of the right hand side is \(e^x\sin x\text{.}\) Here goes. By the product rule
There is another way to find \(\int e^x\sin x\dee{x}\) and \(\int e^x\cos x\dee{x}\) that, in contrast to the above computations, doesn’t involve any trickery. But it does require the use of complex numbers and so is beyond the scope of this course. The secret is to use that \(\sin x =\frac{e^{ix}-e^{-ix}}{2i}\) and \(\cos x =\frac{e^{ix}+e^{-ix}}{2}\text{,}\) where \(i\) is the square root of \(-1\) of the complex number system. See Example B.2.6.
Exercises1.7.2Exercises
Exercises — Stage 1
.
1.
The method of integration by substitution comes from the \(\Rule{2cm}{1pt}{0pt}\) rule for differentiation.
The method of integration by parts comes from the \(\Rule{2cm}{1pt}{0pt}\) rule for differentiation.
2.
Suppose you want to evaluate an integral using integration by parts. You choose part of your integrand to be \(u\text{,}\) and part to be \(\dee{v}\text{.}\) The part chosen as \(u\) will be: (differentiated, antidifferentiated). The part chosen as \(\dee{v}\) will be: (differentiated, antidifferentiated).
3.
Let \(f(x)\) and \(g(x)\) be differentiable functions. Using the quotient rule for differentiation, give an equivalent expression to \(\displaystyle\int \frac{f'(x)}{g(x)}\dee{x}\text{.}\)
4.
Suppose we want to use integration by parts to evaluate \(\displaystyle\int u(x)\cdot v'(x) \dee{x}\) for some differentiable functions \(u\) and \(v\text{.}\) We need to find an antiderivative of \(v'(x)\text{,}\) but there are infinitely many choices. Show that every antiderivative of \(v'(x)\) gives an equivalent final answer.
5.
Suppose you want to evaluate \(\displaystyle\int f(x)\dee{x}\) using integration by parts. Explain why \(\dee{v} = f(x)\dee{x}\text{,}\)\(u=1\) is generally a bad choice.
Note: compare this to Example 1.7.8, where we chose \(u=f(x)\text{,}\)\(\dee{v}=1\dee{x}\text{.}\)
Let \(R\) be the part of the first quadrant that lies below the curve \(y=\arctan x\) and between the lines \(x=0\) and \(x=1\text{.}\)
Sketch the region \(R\) and determine its area.
Find the volume of the solid obtained by rotating \(R\) about the \(y\)--axis.
27.(✳).
Let \(R\) be the region between the curves \(T(x) = \sqrt{x}e^{3x}\) and \(B(x) = \sqrt{x}(1+2x)\) on the interval \(0 \le x \le 3\text{.}\) (It is true that \(T(x)\ge B(x)\) for all \(0\le x\le 3\text{.}\)) Compute the volume of the solid formed by rotating \(R\) about the \(x\)-axis.
28.(✳).
Let \(f(0) = 1\text{,}\)\(f(2) = 3\) and \(f'(2) = 4\text{.}\) Calculate \(\displaystyle\int_0^4 f''\big(\sqrt{x}\big)\,\dee{x}\text{.}\)