Skip to main content

Section 3.1 Integration by Parts

Integration by parts is the anti-derivative version of the product rule.
Recall the differential form version of the product rule looks like
\begin{equation*} d(uv) = udv + vdu. \end{equation*}
Taking indefinite integral on both sides and rearranging terms yields an equation between two classes of functions:
\begin{equation} \int u dv = uv - \int vdu. \tag{3.1} \end{equation}
It will be helpful for working out \(\int udv\) if, say, finding \(\int vdu\) is easier.
By making the variable explicit, Equation (3.1) reads
\begin{equation*} \int u(x)v'(x)\ dx = u(x)v(x) - \int v(x)u'(x)\ dx. \label{eq_IBP-var} \end{equation*}
Also, when integration by parts can be applied, i.e. \(u(x)\) and \(v(x)\) are differentiable functions, it follows from the fundamental theorem of Calculus that the analogous relation holds for definite integrals,
\begin{equation*} \int_a^b u(x)v'(x)\ dx = u(x)v(x)\biggr\rvert_a^b - \int_a^b v(x)u'(x)\ dx. \end{equation*}

Example 3.1.

Let us use integration by parts to work out the indefinite integral \(\int \ln(x)\ dx\text{.}\) Comparing \(\ln(x)dx\) with \(udv\text{,}\) we can set \(u=\ln(x)\) and \(dv = dx\text{.}\) Clearly, \(v(x)=x\) is a function with \(dv=dx\text{.}\) Now according to Equation (3.1)
\begin{align*} \int \ln(x) dx & = x\ln(x) - \int x d\ln(x) \\ & = x\ln(x) - \int x \frac{1}{x} dx \\ & = x\ln(x) - \int dx \\ & = x\ln(x) - x + C. \end{align*}

Checkpoint 3.2.

Find the indefinite integral \(\ds \int x\cos(x) dx\text{.}\)
Solution.
\(u=x\)\(dv = \cos(x)dx\text{.}\)\(v(x)\)\(dv = \cos(x)dx\)\(\int \cos(x)dx\text{.}\)\(\frac{d}{dx} \sin(x) = \cos(x)\text{,}\)\(v=\sin(x)\text{.}\)(3.1)
\begin{align*} \int x\cos(x)dx & = x\sin(x)-\int \sin(x)dx \\ & =x\sin(x)- (-\cos(x)) + C \\ & =x\sin(x) +\cos(x) + C. \end{align*}

Checkpoint 3.3.

Find the indefinite integral \(\ds \int x^2\sin(x) dx\text{.}\)
Hint.
Set \(u=x^2\) and \(dv = \sin(x)dx\text{.}\) Then apply IBP twice.

Example 3.4.

As another example, let us compute \(\int e^x \cos(x) dx\text{.}\) Let \(u = e^x\) and \(dv = \cos(x) dx\text{.}\) Then \(du = e^x dx\) and we take \(v = \sin(x)\text{.}\) So IBP yields,
\begin{equation*} \int e^x \cos(x) dx = e^x\sin(x) - \int e^x \sin(x)dx. \end{equation*}
At the first glance, we are getting nowhere because computing \(\int e^x \sin(x) dx\) is as hard as the original problem. However, applying IBP one more time, we get
\begin{equation*} \int e^x \sin(x)dx = -e^x \cos(x) + \int e^x \cos(x)dx \end{equation*}
and the original integral, call it \(J\text{,}\) reappears. Thus,
\begin{align*} J &= e^x \sin x - (-e^x\cos x + J) \\ 2J & = e^x (\sin x + \cos x)+ C \\ J & = \frac{e^x(\sin x + \cos x)}{2} + C. \end{align*}

Checkpoint 3.5.

Compute the integral in the example above that is, compute\(\int e^x\cos(x) dx\) again but this time set \(u=\cos(x)\) and \(dv = e^x dx\text{.}\) (See also Exercise 3.5.5.)
In some situations, IBP leads to relations called reduction formulas. For instance, using IBP we have
\begin{align*} \int \sin^n(x) dx = & -\sin^{n-1}(x)\cos(x) + (n-1)\int \sin^{n-2}(x) dx\\ & - (n-1)\int \sin^n(x) dx. \end{align*}
Write \(I_k\) for the integral \(\int \sin^k(x)dx\) then the above relation can be rearranged as
\begin{equation} I_n = -\frac{1}{n}\sin^{n-1}(x) \cos(x) + \frac{n-1}{n}I_{n-2}. \tag{3.2} \end{equation}
Each application of (3.2) reduces to power of the integrand (in this case, by 2). Eventually, the problem becomes finding either \(I_1=\int \sin(x)dx\) (\(n\) odd) or \(I_0=\int dx\) (\(n\) even) which has already been solved.

Example 3.6.

As an example, let us compute the integral \(\int \sin^3(x) dx\text{.}\) For \(n=3\text{,}\) the reduction (3.2) reads
\begin{align*} \int \sin^3(x)dx &= I_3 = -\frac{1}{3}\sin^2(x)\cos(x) + \frac{2}{3}I_1 \\ &= -\frac{1}{3}\sin^2(x)\cos(x) + \frac{2}{3}\int\sin(x) dx \\ &= -\frac{1}{3}\sin^2(x)\cos(x) - \frac{2}{3}\cos(x) +C. \end{align*}
See Exercise 3.5.3 for reduction formulas for powers of other trigonometric functions.

Example 3.7.

Example 3.1 naturally needs to the following reduction formula for the integral of powers of \(\ln(x)\) Write \(I_n = \ds \int (\ln(x))^n dx\text{.}\) Then
\begin{align*} I_n & = x(\ln(x))^n - \int xd(\ln(x))^n \\ &= x(\ln(x))^n - \int x n(\ln(x))^{n-1} \frac{1}{x} dx \\ &= x(\ln(x))^n - nI_{n-1} \end{align*}
For instance, applying this for \(n=3\text{,}\) we get
\begin{align*} I_3 & = x(\ln(x))^3 - 3I_2 \\ & = x(\ln(x))^3 - 3(x(\ln(x))^2-2I_1) \\ & = x(\ln(x))^3 - 3x(\ln(x))^2 +6I_1\\ & = x(\ln(x))^3 - 3x(\ln(x))^2 + 6x\ln(x)-6x +C \end{align*}

Example 3.8.

This time let us evaluate the integral \(\ds \int x\arctan(2x) dx\) using integration by parts. Since the antiderivates of \(\arctan(2x)\) is not readily available, this prompts one to try \(u=\arctan(2x)\) and \(dv = xdx\text{.}\) So, \(du = \dfrac{2 dx}{1+4x^2}\) and one can take \(v=x^2/2\text{.}\) Thus,
\begin{align*} \int x\arctan(2x) dx &= \frac{x^2\arctan(2x)}{2} - \int \frac{x^2}{1+4x^2}dx \end{align*}
To integrate the rational function \(\frac{x^2}{1+4x^2}\text{,}\) we carry out the division and get
\begin{equation*} \frac{x^2}{1+4x^2} = \frac{1}{4} \left(1 - \frac{1}{1+4x^2} \right) \end{equation*}
From the expression on the right hand side, one recognizes \(\frac{1}{4}\left(x - \frac{1}{2}\arctan(2x)\right)\) is an anit-derivative. Therefore, the original indefinite integral is evaluated to
\begin{gather*} \frac{x^2\arctan(2x)}{2} - \frac{x}{4} + \frac{1}{8}\arctan(2x)+C \end{gather*}