๐Ÿงฉ Integration by Parts

A Level Maths Year 2 ยท Integration

Level 3 · Ages 17–18

← Back to topic overview
1 The Formula

Substitution reverses the chain rule. Integration by parts reverses the product rule, and is the tool for integrating a product of two unrelated functions, such as $x e^x$ or $x\cos x$.

Integration by parts
$\displaystyle\int u\,\frac{dv}{dx}\,dx = uv - \int v\,\frac{du}{dx}\,dx$
Where it comes from. The product rule says $\dfrac{d}{dx}(uv) = u\dfrac{dv}{dx} + v\dfrac{du}{dx}$. Integrate both sides: $uv = \displaystyle\int u\frac{dv}{dx}\,dx + \int v\frac{du}{dx}\,dx$, then rearrange.

You split the integrand into two pieces: one you will differentiate ($u$) and one you will integrate ($\dfrac{dv}{dx}$). The method succeeds when $\displaystyle\int v\frac{du}{dx}\,dx$ is easier than what you started with.

Worked Example 1 โ€” The basic case

Find $\displaystyle\int x e^x\,dx$.

โ‘ $u = x \Rightarrow \dfrac{du}{dx} = 1$;  $\dfrac{dv}{dx} = e^x \Rightarrow v = e^x$.
โ‘ก$\displaystyle\int x e^x\,dx = x e^x - \int e^x \cdot 1\,dx$
โ‘ข$= x e^x - e^x + c = e^x(x - 1) + c$
Check: $\dfrac{d}{dx}\left[e^x(x-1)\right] = e^x(x-1) + e^x = xe^x$ โœ“
Worked Example 2 โ€” With a trig function

Find $\displaystyle\int x\cos 2x\,dx$.

โ‘ $u = x \Rightarrow \dfrac{du}{dx} = 1$;  $\dfrac{dv}{dx} = \cos 2x \Rightarrow v = \tfrac{1}{2}\sin 2x$.
โ‘ก$= \tfrac{1}{2}x\sin 2x - \displaystyle\int \tfrac{1}{2}\sin 2x\,dx$
โ‘ข$= \tfrac{1}{2}x\sin 2x + \tfrac{1}{4}\cos 2x + c$
Watch the double negative: $\int \sin 2x\,dx = -\tfrac{1}{2}\cos 2x$, and it is being subtracted, giving $+\tfrac{1}{4}\cos 2x$.
2 Choosing $u$

Choose $u$ so that it gets simpler when differentiated, and make sure the other part can actually be integrated.

Priority for $u$TypeReason
1st$\ln x$You cannot easily integrate $\ln x$, but its derivative $\tfrac{1}{x}$ is simple.
2ndPolynomials $x,\;x^2,\ldots$Each differentiation lowers the power until it vanishes.
Last$e^{kx}$, $\sin kx$, $\cos kx$These never get simpler, so let them be $\dfrac{dv}{dx}$.
The wrong choice makes it worse. In $\int xe^x\,dx$, taking $u = e^x$ and $\dfrac{dv}{dx} = x$ gives $\tfrac{1}{2}x^2e^x - \int\tfrac{1}{2}x^2 e^x\,dx$ โ€” the new integral is harder than the original. If that happens, swap.
3 Using Parts More Than Once

With $x^2$ as $u$, one application leaves an integral containing $x$. Apply parts again to that.

Worked Example 3 โ€” Parts twice

Find $\displaystyle\int x^2 e^x\,dx$.

โ‘ $u = x^2$, $\dfrac{dv}{dx} = e^x$:  $\displaystyle\int x^2e^x\,dx = x^2e^x - \int 2xe^x\,dx$
โ‘กFrom Example 1, $\displaystyle\int 2xe^x\,dx = 2(xe^x - e^x)$.
โ‘ข$= x^2e^x - 2xe^x + 2e^x + c$
โ‘ฃ$= e^x\left(x^2 - 2x + 2\right) + c$
Use brackets around the second integral when you substitute it in. Most lost marks here are sign errors from the minus sign in front.
Worked Example 4 โ€” Stretch: when the integral comes back

Find $\displaystyle I = \int e^x\sin x\,dx$.

โ‘ $u = \sin x$, $\dfrac{dv}{dx} = e^x$:  $I = e^x\sin x - \displaystyle\int e^x\cos x\,dx$
โ‘กAgain with $u = \cos x$:  $\displaystyle\int e^x\cos x\,dx = e^x\cos x + \int e^x\sin x\,dx = e^x\cos x + I$
โ‘ขSo $I = e^x\sin x - e^x\cos x - I$, giving $2I = e^x(\sin x - \cos x)$.
โ‘ฃ$I = \tfrac{1}{2}e^x(\sin x - \cos x) + c$
Neither part simplifies here, but after two applications the original integral reappears and can be solved for like an unknown. Keep the same type of choice for $u$ (trig) both times, or you will undo your first step.
4 Integrals Involving $\ln x$
The trick for $\int \ln x\,dx$: write it as $\displaystyle\int \ln x \times 1\,dx$, and take $u = \ln x$, $\dfrac{dv}{dx} = 1$.
Worked Example 5 โ€” Integrating ln x

Find $\displaystyle\int \ln x\,dx$.

โ‘ $u = \ln x \Rightarrow \dfrac{du}{dx} = \dfrac{1}{x}$;  $\dfrac{dv}{dx} = 1 \Rightarrow v = x$.
โ‘ก$= x\ln x - \displaystyle\int x \cdot \frac{1}{x}\,dx = x\ln x - \int 1\,dx$
โ‘ข$= x\ln x - x + c$
Worked Example 6 โ€” A power times ln x

Find $\displaystyle\int x^2\ln x\,dx$.

โ‘ $\ln x$ takes priority: $u = \ln x$, $\dfrac{dv}{dx} = x^2 \Rightarrow v = \tfrac{1}{3}x^3$.
โ‘ก$= \tfrac{1}{3}x^3\ln x - \displaystyle\int \tfrac{1}{3}x^3 \cdot \frac{1}{x}\,dx = \tfrac{1}{3}x^3\ln x - \int\tfrac{1}{3}x^2\,dx$
โ‘ข$= \tfrac{1}{3}x^3\ln x - \tfrac{1}{9}x^3 + c$
5 Definite Integrals by Parts
With limits
$\displaystyle\int_a^b u\,\frac{dv}{dx}\,dx = \Big[uv\Big]_a^b - \int_a^b v\,\frac{du}{dx}\,dx$
Worked Example 7 โ€” A trig definite integral

Evaluate $\displaystyle\int_0^{\pi/2}x\sin x\,dx$.

โ‘ $u = x$, $\dfrac{dv}{dx} = \sin x \Rightarrow v = -\cos x$.
โ‘ก$= \Big[-x\cos x\Big]_0^{\pi/2} + \displaystyle\int_0^{\pi/2}\cos x\,dx$
โ‘ข$= \Big[-x\cos x + \sin x\Big]_0^{\pi/2} = \left(0 + 1\right) - \left(0 + 0\right) = 1$
Worked Example 8 โ€” An exact answer with ln

Show detailed reasoning. Show that $\displaystyle\int_1^e x\ln x\,dx = \frac{e^2 + 1}{4}$.

โ‘ $u = \ln x$, $\dfrac{dv}{dx} = x \Rightarrow v = \tfrac{1}{2}x^2$.
โ‘ก$\displaystyle\int x\ln x\,dx = \tfrac{1}{2}x^2\ln x - \int\tfrac{1}{2}x\,dx = \tfrac{1}{2}x^2\ln x - \tfrac{1}{4}x^2$
โ‘ขAt $x = e$: $\tfrac{1}{2}e^2(1) - \tfrac{1}{4}e^2 = \tfrac{1}{4}e^2$.  At $x = 1$: $0 - \tfrac{1}{4} = -\tfrac{1}{4}$.
โ‘ฃ$\tfrac{1}{4}e^2 - \left(-\tfrac{1}{4}\right) = \dfrac{e^2+1}{4}$ โœ“
6 Quick Reference

Formula

$\int u v'\,dx = uv - \int v u'\,dx$

Use it for

Products of unrelated functions: $x e^x$, $x\sin x$, $x^n\ln x$.

Choose u

$\ln x$ first, then polynomials, then $e^x$ / trig.

ln x alone

Write as $\ln x \times 1$: $\int\ln x\,dx = x\ln x - x + c$.

xยฒ

Needs parts twice.

Cyclic

$e^x\sin x$: parts twice, then solve for $I$.

Limits

Apply to $\big[uv\big]$ and to the second integral.

Check

Differentiate your answer with the product rule.

7 Practice Questions
Question 1

Find $\displaystyle\int x e^{2x}\,dx$.

โ–ถ Show solution

$u = x$, $\dfrac{dv}{dx} = e^{2x} \Rightarrow v = \tfrac{1}{2}e^{2x}$.

$= \tfrac{1}{2}xe^{2x} - \displaystyle\int\tfrac{1}{2}e^{2x}\,dx = \tfrac{1}{2}xe^{2x} - \tfrac{1}{4}e^{2x} + c$

Question 2

Find $\displaystyle\int x\sin x\,dx$.

โ–ถ Show solution

$u = x$, $v = -\cos x$.

$= -x\cos x + \displaystyle\int\cos x\,dx = -x\cos x + \sin x + c$

Question 3

Find $\displaystyle\int (2x+1)e^x\,dx$.

โ–ถ Show solution

$u = 2x + 1 \Rightarrow \dfrac{du}{dx} = 2$; $v = e^x$.

$= (2x+1)e^x - \displaystyle\int 2e^x\,dx = (2x+1)e^x - 2e^x + c = (2x - 1)e^x + c$

Question 4

Find the exact value of $\displaystyle\int_0^1 xe^{-x}\,dx$.

โ–ถ Show solution

$u = x$, $v = -e^{-x}$.

$\displaystyle\int xe^{-x}\,dx = -xe^{-x} + \int e^{-x}\,dx = -xe^{-x} - e^{-x}$

$\Big[-xe^{-x} - e^{-x}\Big]_0^1 = \left(-e^{-1} - e^{-1}\right) - (0 - 1) = 1 - \dfrac{2}{e}$

Question 5

Show that $\displaystyle\int_1^2\ln x\,dx = 2\ln 2 - 1$.

โ–ถ Show solution

$\displaystyle\int\ln x\,dx = x\ln x - x$ (parts with $u = \ln x$, $\dfrac{dv}{dx} = 1$).

$\Big[x\ln x - x\Big]_1^2 = (2\ln 2 - 2) - (0 - 1) = 2\ln 2 - 1$ โœ“

Question 6

Find $\displaystyle\int x^3\ln x\,dx$.

โ–ถ Show solution

$u = \ln x$, $\dfrac{dv}{dx} = x^3 \Rightarrow v = \tfrac{1}{4}x^4$.

$= \tfrac{1}{4}x^4\ln x - \displaystyle\int\tfrac{1}{4}x^3\,dx = \tfrac{1}{4}x^4\ln x - \tfrac{1}{16}x^4 + c$

Question 7

Find $\displaystyle\int x^2\cos x\,dx$.

โ–ถ Show solution

$u = x^2$, $v = \sin x$:  $= x^2\sin x - \displaystyle\int 2x\sin x\,dx$

From Question 2, $\displaystyle\int 2x\sin x\,dx = 2(-x\cos x + \sin x)$.

$= x^2\sin x + 2x\cos x - 2\sin x + c$

Question 8

Show that $\displaystyle\int_0^{\pi/4}x\sec^2 x\,dx = \frac{\pi}{4} - \frac{1}{2}\ln 2$.

โ–ถ Show solution

$u = x$, $\dfrac{dv}{dx} = \sec^2 x \Rightarrow v = \tan x$.

$= \Big[x\tan x\Big]_0^{\pi/4} - \displaystyle\int_0^{\pi/4}\tan x\,dx$

$\displaystyle\int\tan x\,dx = -\ln|\cos x|$, so this is $\Big[x\tan x + \ln\cos x\Big]_0^{\pi/4}$.

$= \tfrac{\pi}{4}(1) + \ln\tfrac{1}{\sqrt{2}} - (0 + \ln 1) = \tfrac{\pi}{4} - \tfrac{1}{2}\ln 2$ โœ“

Question 9

Find the exact value of $\displaystyle\int_1^e\frac{\ln x}{x^2}\,dx$.

โ–ถ Show solution

$u = \ln x$, $\dfrac{dv}{dx} = x^{-2} \Rightarrow v = -x^{-1}$.

$\displaystyle\int\frac{\ln x}{x^2}\,dx = -\frac{\ln x}{x} + \int\frac{1}{x^2}\,dx = -\frac{\ln x}{x} - \frac{1}{x}$

$\left[-\dfrac{\ln x}{x} - \dfrac{1}{x}\right]_1^e = \left(-\dfrac{1}{e} - \dfrac{1}{e}\right) - (0 - 1) = 1 - \dfrac{2}{e}$

Question 10

The curve $C$ has equation $y = xe^{-x/2}$, $x \geqslant 0$.

(a) Find the exact coordinates of the stationary point of $C$.   (b) Show that $\displaystyle\int xe^{-x/2}\,dx = -2xe^{-x/2} - 4e^{-x/2} + c$.   (c) Find the exact area of the region bounded by $C$, the $x$-axis and the line through the stationary point parallel to the $y$-axis, and give it to 3 significant figures.   (d) Find the exact area between $C$, the $x$-axis and the line $x = 4$.

โ–ถ Show solution

(a) Product rule: $\dfrac{dy}{dx} = e^{-x/2} - \tfrac{1}{2}xe^{-x/2} = e^{-x/2}\left(1 - \tfrac{x}{2}\right)$.

$e^{-x/2} \neq 0$, so $x = 2$ and $y = 2e^{-1}$. Stationary point $\left(2, \dfrac{2}{e}\right)$.

(b) $u = x$, $\dfrac{dv}{dx} = e^{-x/2} \Rightarrow v = -2e^{-x/2}$.

$= -2xe^{-x/2} + \displaystyle\int 2e^{-x/2}\,dx = -2xe^{-x/2} - 4e^{-x/2} + c$ โœ“

(c) $\Big[-2xe^{-x/2} - 4e^{-x/2}\Big]_0^2 = \left(-4e^{-1} - 4e^{-1}\right) - (0 - 4) = 4 - \dfrac{8}{e} \approx 1.06$

(d) $\Big[-2xe^{-x/2} - 4e^{-x/2}\Big]_0^4 = \left(-8e^{-2} - 4e^{-2}\right) + 4 = 4 - \dfrac{12}{e^2}$ ($\approx 2.38$). The curve is above the axis for all $x > 0$, so no splitting is needed.

Integration by Parts · A Level Maths Year 2 · Created with MathJax