Integration by Parts
Integration by parts is nothing more than the product rule applied to integration. To arrive at the formula for integration by parts, recall that
$$(uv)’ = uv’ + u’v$$
Now, integrate both sides:
$$\int(uv)’ = \int uv’ + \int u’v$$
The term on the left-hand side is the antiderivative of the derivative of $uv$, so we can just write...
$$uv = \int uv’ + \int u’v$$
We’ll solve for one of the remaining integrals to get
$$\int uv’ = uv - \int u’v$$
Lastly, we rewrite $u’$ as $du$ and $v’$ as $dv$ to get our integration by parts template:
$$\boxed{ \int u\ dv = uv - \int v\ du }$$
Example
$$\int x e^x\ dx$$
First, we choose $u$ and $dv$ making sure, between the two terms, we include everything that’s in the original integral.
-
Let $u = x$ and $dv = e^x \ dx$.
-
$du = dx$
-
$v = \int e^x\ dx = e^x$
So, we have
$$\begin{aligned} \int x e^x \ dx &= x e^x - \int e^x\ dx\cr &= \boxed{xe^x - e^x + C} \end{aligned}$$
Example
$$\int x^2 \sin x \ dx$$
-
Let $u = x^2$ and $dv = \sin x \ dx$.
-
$du = 2x\ dx$
-
$v = -\cos{x}$
$$\begin{aligned} \int x^2 \sin x \ dx &= x^2(-\cos x) - \int 2x(-\cos x) \ dx\cr &= -x^2\cos x + \int 2x\cos x \ dx\cr \end{aligned}$$
Notice that the integral on the right-hand side also requires integration by parts! Let’s look at that integral separately.
-
Let $u = 2x$ and $dv = \cos x$
-
$du = 2dx$
-
$v = \sin{x}$
$$\begin{aligned} \int 2x\cos x \ dx &= 2x\sin x - \int 2\sin x\ dx\cr &= 2x\sin x + 2\cos x \end{aligned}$$
Now we can put it all together
$$\begin{aligned} \int x^2 \sin x \ dx &= -x^2\cos x + \left(\int 2x\cos x \ dx\right)\cr &= -x^2\cos x + \left(2x\sin x + 2\cos x\right) + C\cr &= \boxed{-x^2\cos x + 2x\sin x + 2\cos x + C} \end{aligned}$$
Choosing $u$ and $dv$
There’s a really helpful acronym that tells us how to choose $u$ and $dv$: LIATED (the word DETAIL spelled backwards)
LIATED
| Function Type | Examples | |
|---|---|---|
| L | Logarithmic Functions | $\ln x$ or $\log_2 x$ |
| I | Inverse Functions | $\arctan x$ or $\arcsin x$ |
| A | Algebraic Functions | $x$ or $4x^3$ or $\sqrt{x}$ |
| T | Trigonometric Functions | $\sin x$ or $\tan x$ |
| E | Exponential Function | $e^x$ or $e^{3x}$ or $5^x$ |
| D | Differential | just $dx$ |
The way this works is we choose $u$ to be the function whose type appears first in this list and $dv$ to be everything else. Here are some examples:
-
In $\int x e^x\ dx$ we have an algebraic term, $x$, and an exponential term, $e^x$. Since A comes first in LIATED, we choose $u = x$ and $dv = e^x\ dx$.
-
In $\int x^2 \sin x\ dx$ we have an algebraic term, $x^2$, and a trigonometric term, $\sin x$. Since A comes first in LIATED, we choose $u = x^2$ and $dv = \sin x\ dx$.
-
In $\int x \ln x\ dx$ we have an algebraic term, $x$, and a logarithmic term, $\ln x$. Since L comes first, we choose $u = \ln x$ and $dv = x\ dx$.
-
In $\int \arctan x \ dx$ all we have is an inverse function, $\arctan x$, and a differential term, $dx$. Since I comes first, we choose $u = \arctan x$ and $dv = dx$.
Exercise
$$\int x\cos{2x}\ dx$$
Solution
Let $u = x$ and $dv = cos(2x) \ dx$.
Then, $du = dx$ and $v = \frac12 \sin (2x)$
$$\begin{aligned} \int x\cos{2x}\ dx &= \frac12 x \sin( 2x ) - \int \frac12 \sin( 2x ) \ dx\cr &= \boxed{\frac12 x \sin( 2x ) + \frac14 \cos(2x) + C} \end{aligned}$$
Exercise
$$\int\arcsin{x}\ dx$$
Solution
Let $u = \arcsin x$ and $dv = dx$.
Then $du = \frac{1}{\sqrt{1 - x^2}} \ dx$ and $v = x$.
$$\begin{aligned} \int\arcsin{x}\ dx &= x \arcsin x - \int \frac{x}{\sqrt{1 - x^2}} \ dx \ \leftarrow \boxed{u=1-x^2, \ du = -2x\ dx}\cr &= x \arcsin x + \frac12 \int \frac{1}{\sqrt{u}} \ du\cr &= x \arcsin x + \frac12 (2\sqrt{u}) + C\cr &= \boxed{x \arcsin x + \sqrt{1 - x^2} + C}\cr \end{aligned}$$
Exercise
$$\int e^{x}\cos{x}\ dx$$
Solution
Let $u = \cos x$ and $dv = e^x$.
Then $du = -\sin x \ dx$ and $v = e^x$.
$$\begin{aligned} \int e^{x}\cos{x}\ dx &= e^x \cos x + \int e^x \sin x \ dx \end{aligned}$$
Do integration by parts again: $u = \sin x$ and $dv = e^x \ dx$. So, $du = \cos x \ dx$ and $v = e^x$.
$$\begin{aligned} \int e^{x}\cos{x}\ dx &= e^x \cos x + \int e^x \sin x \ dx\cr &= e^x \cos x + e^x \ sin x - \int e^x\cos x \ dx\cr 2 \int e^{x}\cos{x}\ dx &= e^x \cos x + e^x \ sin x\cr \int e^{x}\cos{x}\ dx &= \boxed{\frac12e^x \cos x + \frac12e^x \ sin x + C}\cr \end{aligned}$$
Exercise
$$\int_0^2xe^{2x} \ dx$$
Solution
First, let’s find the antiderivative for $xe^{2x}$:
Let $u = x$ and $dv = e^{2x} \ dx$. Then $du = dx$ and $v = \frac12 e^{2x}$.
$$\begin{aligned} \int xe^{2x} \ dx &= \frac12 x e^{2x} - \int \frac12 e^{2x} \ dx\cr &= \frac12 x e^{2x} - \frac14 e^{2x}\cr \int_0^2xe^{2x} \ dx &= \frac12 x e^{2x} - \frac14 e^{2x} \biggr\rvert_0^2\cr &= \left(e^4 - \frac14 e^4\right) - \left(0 - \frac14\right)\cr &= \boxed{\frac34 e^4 + \frac14} \end{aligned}$$
Exercise
$$\int_1^ex^2\ln{x}\ dx$$
Solution
Let $u = \ln x$ and $dv = x^2$. Then $du = \frac1x dx$ and $v = \frac13 x^3$.
$$\begin{aligned} \int x^2\ln{x}\ dx &= \frac13 x^3 \ln x - \int \frac13 x^3 \cdot \frac1x \ dx\cr &= \frac13 x^3 \ln x - \int \frac13 x^2 \ dx\cr &= \frac13 x^3 \ln x - \frac19 x^3 + C\cr \int_1^ex^2\ln{x}\ dx &= \frac13 x^3 \ln x - \frac19 x^3 \biggr\rvert_1^e\cr &= \left(\frac13 e^3 \ln(e) - \frac19 e^3\right) - \left(\frac13 \ln(1) - \frac19\right)\cr &= \boxed{\frac29 e^3 + \frac19} \end{aligned}$$
Exercise
$$\int\left(\ln{x}\right)^2\ dx$$
Solution
Let $u = (\ln x)^2$ and $dv = dx$. Then $du = \frac2x \ln x \ dx$ and $v = x$.
$$\begin{aligned} \int\left(\ln{x}\right)^2\ dx &= x(\ln x)^2 - \int 2 \ln x\ dx \end{aligned}$$
Let $u = \ln x$ and $dv = dx$. Then $du = \frac 1x \ dx$ and $v = x$.
$$\begin{aligned} \int\left(\ln{x}\right)^2\ dx &= x(\ln x)^2 - \int 2 \ln x\ dx\cr &= x(\ln x)^2 - 2\left( x\ln x - \int 1 \ dx\right)\cr &= x(\ln x)^2 - 2x\ln x + 2x + C\cr \end{aligned}$$
Example
$$\int e^{\sqrt{x}}\ dx$$
Let $t = \sqrt{t}$. Then $dt = \frac{1}{2\sqrt{x}} \ dx \Longrightarrow dx = 2\sqrt{x}\ dt = 2 t \ dt$
$$\begin{aligned} \int e^{\sqrt{x}}\ dx &= \int 2 t e^t \ dt\cr &= 2 \int t e^t \ dt\cr &= 2te^t - 2e^t + C\cr &= \boxed{2\sqrt{x}e^{\sqrt{x}} - 2e^{\sqrt{x}} + C} \end{aligned}$$
Exercise
$$\int \sin{(\ln{x})}\ dx$$
Hint: Make a t-substitution first, and then use integration by parts.
Solution
Let $t = \ln x$. Then $dt = \frac1x dx \Longrightarrow dx = x\ dt = e^t \ dt$.
$$\begin{aligned} \int \sin{(\ln{x})}\ dx &= \int e^t \sin t \ dt\cr &= \frac12 e^t \sin t - \frac12\int e^t \cos t\cr &= \frac12 x \sin \ln x - \frac12 x \cos \ln x + C\cr \end{aligned}$$