---
title: Integration by Parts
module: Techniques of Integration
moduleNumber: 7
lessonNumber: 1
order: 701
summary: >
  The product rule for derivatives reverses into integration by parts, trading
  the integral of $u\,\d v$ for the integral of $v\,\d u$ whenever the second is
  easier. The LIATE ordering fixes which factor to differentiate. Standard
  cases: a polynomial against a transcendental factor, repeated parts, cyclic
  integrals that solve for themselves, and reduction formulas that peel an
  exponent down by recursion.
topics: [Techniques of Integration]
sources:
  - book: Stewart
    ref: "Ch. 7 — Techniques of Integration; §7.1 Integration by Parts"
---

The [substitution rule](/calculus/integrals/the-substitution-rule) is the chain
rule read backward. Integration by parts is the
[product rule](/calculus/derivatives/differentiation-rules-and-the-chain-rule)
read backward. Both convert a hard integral into an easier one, and between them
they handle a large fraction of the integrals that have elementary
antiderivatives.

Start from the product rule for differentiable $f$ and $g$:

$$
\frac{\d}{\d x}\bigl[f(x)\,g(x)\bigr] = f(x)\,g'(x) + g(x)\,f'(x).
$$

Integrate both sides. The left side integrates to $f(x)\,g(x)$, and the right
side splits into two integrals:

$$
f(x)\,g(x) = \int f(x)\,g'(x)\,\d x + \int g(x)\,f'(x)\,\d x.
$$

Solving for the first integral on the right gives the formula.[^parts]

> **Theorem (Integration by parts).** If $f$ and $g$ are differentiable, then
> $$
> \int f(x)\,g'(x)\,\d x = f(x)\,g(x) - \int g(x)\,f'(x)\,\d x.
> $$

The formula is easier to remember with the substitutions $u = f(x)$ and
$v = g(x)$, so that $\d u = f'(x)\,\d x$ and $\d v = g'(x)\,\d x$:

$$
\int u\,\d v = uv - \int v\,\d u.
$$

Reading it as a strategy: an integrand is split into a part $u$ that will be
differentiated and a part $\d v$ that will be integrated. The exchange is only
worthwhile when $\int v\,\d u$ is simpler than $\int u\,\d v$. Choosing $u$ and $\d v$
well is the entire skill.

## The formula as areas

For a positive increasing function the formula has a direct reading as areas.
Let $v = v(u)$ run from $(a,c)$ to $(b,d)$. The corner rectangle of area $bd$
splits along the curve into the region under it and the region to its left, and
subtracting the inner rectangle $ac$ leaves the standard statement
$\int u\,\d v + \int v\,\d u = uv\big|$.

$$
% caption: The region left of the curve ($\int u\,dv$) and the region beneath it ($\int v\,du$) tile the area between the two corner rectangles, which is $uv$ evaluated across the interval.
\begin{tikzpicture}[scale=1.0,>=stealth,font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\fill[acc!9] (1.2,0) -- (5.0,0) -- (5.0,4.2) .. controls (3.8,3.0) and (2.5,2.4) .. (1.2,1.0) -- cycle;
\fill[acc!20] (0,1.0) -- (1.2,1.0) .. controls (2.5,2.4) and (3.8,3.0) .. (5.0,4.2) -- (0,4.2) -- cycle;
\draw[->,black] (0,0) -- (6.3,0) node[right,black]{$u$};
\draw[->,black] (0,0) -- (0,5.0) node[above,black]{$v$};
\draw[acc,very thick] (1.2,1.0) .. controls (2.5,2.4) and (3.8,3.0) .. (5.0,4.2);
\draw[black,dashed] (1.2,0) -- (1.2,1.0) -- (0,1.0);
\draw[black,dashed] (5.0,0) -- (5.0,4.2) -- (0,4.2);
\fill[acc] (1.2,1.0) circle (1.7pt);
\fill[acc] (5.0,4.2) circle (1.7pt);
\node[below,black] at (1.2,0){$a$};
\node[below,black] at (5.0,0){$b$};
\node[left,black] at (0,1.0){$c$};
\node[left,black] at (0,4.2){$d$};
\node[black] at (3.5,0.75){$\int v\,du$};
\node[black] at (1.35,3.3){$\int u\,dv$};
\end{tikzpicture}
$$

## Choosing $u$ and $dv$

Two requirements constrain the choice: $\d v$ must be something integrable to get
$v$, and $u$ should get simpler (or at least no worse) when differentiated. A
useful ordering for picking $u$ is the acronym **LIATE**: whichever factor comes
first on this list is the one to differentiate, so it becomes $u$; the rest is
$\d v$.

| Priority for $u$ | Class | Example factor | Why differentiate it |
| --- | --- | --- | --- |
| 1 | **L** — logarithmic | $\ln x$ | has no simple antiderivative; its derivative $1/x$ is algebraic |
| 2 | **I** — inverse trig | $\tan^{-1}x$, $\sin^{-1}x$ | same reason; derivative is algebraic |
| 3 | **A** — algebraic | $x^n$ | differentiating lowers the degree toward $0$ |
| 4 | **T** — trigonometric | $\sin x$, $\cos x$ | cycles under both operations; usually goes in $\d v$ |
| 5 | **E** — exponential | $e^x$ | unchanged by both; usually goes in $\d v$ |

LIATE is a guideline, not a theorem; it fails on constructed examples, but it
picks the right split on nearly every integral encountered in practice.

### A polynomial against a trigonometric factor

Consider $\int x \sin x\,\d x$. The integrand is algebraic times trigonometric, so
LIATE selects $u = x$ (the **A** factor) and $\d v = \sin x\,\d x$. Then

$$
u = x, \quad \d v = \sin x\,\d x \;\Longrightarrow\; \d u = \d x, \quad v = -\cos x.
$$

Applying the formula,

$$
\int x \sin x\,\d x = x(-\cos x) - \int (-\cos x)\,\d x = -x\cos x + \int \cos x\,\d x = -x\cos x + \sin x + C.
$$

The exchange replaced $\int x \sin x\,\d x$ with the elementary $\int \cos x\,\d x$.
The opposite choice $u = \sin x$, $\d v = x\,\d x$ produces $\int \tfrac{1}{2}x^2\cos x\,\d x$,
which is worse: differentiating $\sin x$ did not simplify it, and integrating
$x$ raised the degree.

### A single logarithm

Some integrands have no obvious second factor. For $\int \ln x\,\d x$, take
$\d v = \d x$ and let $u$ be the whole integrand:

$$
u = \ln x, \quad \d v = \d x \;\Longrightarrow\; \d u = \frac{1}{x}\,\d x, \quad v = x.
$$

Then

$$
\int \ln x\,\d x = x\ln x - \int x \cdot \frac{1}{x}\,\d x = x\ln x - \int \d x = x\ln x - x + C.
$$

Parts works here because $\ln x$ has a simpler derivative than itself. The same
choice evaluates $\tan^{-1}x$ and $\sin^{-1}x$, the other functions whose
derivatives are algebraic.

When a power of $x$ multiplies the logarithm, still differentiate the logarithm;
one pass turns it algebraic.

> **Worked example.** Evaluate $\int x^2 \ln x\,\d x$.
>
> The logarithm is the **L** factor, so $u = \ln x$ and $\d v = x^2\,\d x$,
> giving $\d u = \tfrac{1}{x}\,\d x$ and $v = \tfrac{1}{3}x^3$:
>
> $$
> \int x^2 \ln x\,\d x = \frac{x^3}{3}\ln x - \int \frac{x^3}{3}\cdot\frac{1}{x}\,\d x = \frac{x^3}{3}\ln x - \frac{1}{3}\int x^2\,\d x.
> $$
>
> The remaining integral is elementary, so
>
> $$
> \int x^2 \ln x\,\d x = \frac{x^3}{3}\ln x - \frac{x^3}{9} + C.
> $$

## Repeated parts

When one application leaves a still-difficult integral, applying parts again may
finish the job. For $\int x^2 e^x\,\d x$, the factor $x^2$ becomes simpler on
differentiation while $e^x$ is unchanged, so $u = x^2$, $\d v = e^x\,\d x$:

$$
\int x^2 e^x\,\d x = x^2 e^x - \int 2x\,e^x\,\d x = x^2 e^x - 2\int x e^x\,\d x.
$$

The remaining $\int x e^x\,\d x$ is simpler but not immediate, so apply parts once
more with $u = x$, $\d v = e^x\,\d x$:

$$
\int x e^x\,\d x = x e^x - \int e^x\,\d x = x e^x - e^x + C.
$$

Substituting back,

$$
\int x^2 e^x\,\d x = x^2 e^x - 2\bigl(x e^x - e^x\bigr) + C = x^2 e^x - 2x e^x + 2e^x + C.
$$

Each pass lowers the polynomial degree by one; a degree-$n$ polynomial against
$e^x$ needs $n$ applications.

### The tabular method

When $u$ is a polynomial (so its derivatives reach $0$) and $\d v$ integrates
easily any number of times, repeated parts can be organized into a table.
Differentiate the left column down to zero, integrate the right column at each
step, and multiply along the diagonals with alternating signs.

$$
% caption: Tabular integration of $\int x^2 e^x\,dx$: differentiate the left column to zero, integrate the right, then read off signed products along the diagonals.
\begin{tikzpicture}[>=stealth,font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\node[black,font=\footnotesize] at (0,0.75){sign};
\node[black,font=\footnotesize] at (2,0.75){differentiate};
\node[black,font=\footnotesize] at (4.6,0.75){integrate};
\foreach \r/\s/\d/\i in {0/+/{$x^2$}/{$e^x$}, 1/-/{$2x$}/{$e^x$}, 2/+/{$2$}/{$e^x$}, 3/-/{$0$}/{$e^x$}}{
  \node[black] at (0,-\r*1.05){\s};
  \node[black] at (2,-\r*1.05){\d};
  \node[black] at (4.6,-\r*1.05){\i};
}
\foreach \r in {0,1,2}{
  \draw[->,black] (2,{-\r*1.05-0.28}) -- (2,{-\r*1.05-0.75});
}
\draw[->,acc,thick] (2.45,0) -- (4.05,-1.05);
\draw[->,acc,thick] (2.45,-1.05) -- (4.05,-2.10);
\draw[->,acc,thick] (2.45,-2.10) -- (4.05,-3.15);
\node[acc,font=\footnotesize,anchor=west] at (5.4,-1.6){$x^2 e^x - 2x e^x + 2 e^x + C$};
\end{tikzpicture}
$$

Written as a procedure:

```algorithm
caption: $\textsc{TabularParts}$ — evaluate $\int p(x)\,g(x)\,dx$ for polynomial $p$
build column $D$ by differentiating $p$ repeatedly until reaching $0$
build column $I$ by integrating $g$ once per row
attach signs $+,-,+,-,\dots$ down the rows
for each entry $D_i$ except the last do
  form the product $D_i \times I_{i+1}$ with the sign of row $i$
result is the sum of these signed products, plus $C$
```

A trigonometric $\d v$ works the same way, since $\cos x$ integrates cyclically
without growing.

> **Worked example.** Evaluate $\int x^2 \cos x\,\d x$ by the tabular method.
>
> Differentiate $x^2$ down to $0$ and integrate $\cos x$ at each step, attaching
> signs $+,-,+$:
>
> | sign | differentiate | integrate |
> | --- | --- | --- |
> | $+$ | $x^2$ | $\sin x$ |
> | $-$ | $2x$ | $-\cos x$ |
> | $+$ | $2$ | $-\sin x$ |
> | | $0$ | $\cos x$ |
>
> Multiply each left entry by the integral one row below it, with the row's
> sign:
>
> $$
> \int x^2 \cos x\,\d x = x^2 \sin x - 2x(-\cos x) + 2(-\sin x) + C = x^2 \sin x + 2x\cos x - 2\sin x + C.
> $$
>
> Differentiating the result returns $x^2\cos x$, confirming the signs.

## Cyclic integrals

Sometimes neither factor simplifies, yet repeated parts still succeeds because
the original integral reappears. For $\int e^x \sin x\,\d x$, choose $u = e^x$,
$\d v = \sin x\,\d x$:

$$
\int e^x \sin x\,\d x = -e^x \cos x + \int e^x \cos x\,\d x.
$$

The new integral is no simpler, but apply parts again with $u = e^x$,
$\d v = \cos x\,\d x$:

$$
\int e^x \cos x\,\d x = e^x \sin x - \int e^x \sin x\,\d x.
$$

Substituting the second line into the first returns the starting integral on the
right:

$$
\int e^x \sin x\,\d x = -e^x \cos x + e^x \sin x - \int e^x \sin x\,\d x.
$$

This is an equation for the unknown integral. Add $\int e^x \sin x\,\d x$ to both
sides and divide by $2$:

$$
\int e^x \sin x\,\d x = \tfrac{1}{2}e^x(\sin x - \cos x) + C.
$$

$$
% caption: Two passes of parts on $\int e^x\sin x\,dx$ regenerate the original integrand, turning the problem into a linear equation solved for the integral.
\begin{tikzpicture}[>=stealth,font=\small,
  box/.style={draw,minimum width=30mm,minimum height=11mm,align=center,font=\footnotesize}]
\definecolor{acc}{HTML}{4A6FA5}
\node[box,draw=acc] (a) at (0,0) {$\int e^x\sin x\,dx$};
\node[box] (b) at (6.0,0) {$\int e^x\cos x\,dx$};
\draw[->,acc,thick] (a) to[bend left=24] node[above,black,font=\footnotesize]{parts} (b);
\draw[->,acc,thick] (b) to[bend left=24] node[below,black,font=\footnotesize]{parts} (a);
\node[black,font=\footnotesize] at (3.0,-2.0){the loop closes: solve for $\int e^x\sin x\,dx$};
\end{tikzpicture}
$$

## Definite integrals by parts

Combining the formula with Part 2 of the
[Fundamental Theorem](/calculus/integrals/the-fundamental-theorem-of-calculus)
gives a version for definite integrals: evaluate the boundary term and integrate
the correction term over the same interval.[^defparts]

> **Theorem (Definite parts).** If $f'$ and $g'$ are continuous on $[a,b]$, then
> $$
> \int_a^b f(x)\,g'(x)\,\d x = \Bigl[f(x)\,g(x)\Bigr]_a^b - \int_a^b g(x)\,f'(x)\,\d x.
> $$

For $\int_0^1 \tan^{-1}x\,\d x$, take $u = \tan^{-1}x$, $\d v = \d x$, so
$\d u = \d x/(1+x^2)$ and $v = x$:

$$
\int_0^1 \tan^{-1}x\,\d x = \Bigl[x\tan^{-1}x\Bigr]_0^1 - \int_0^1 \frac{x}{1+x^2}\,\d x = \frac{\pi}{4} - \int_0^1 \frac{x}{1+x^2}\,\d x.
$$

The remaining integral yields to the substitution $t = 1 + x^2$, $\d t = 2x\,\d x$,
giving $\tfrac{1}{2}\ln 2$. Therefore

$$
\int_0^1 \tan^{-1}x\,\d x = \frac{\pi}{4} - \frac{\ln 2}{2}.
$$

Since $\tan^{-1}x \ge 0$ on $[0,1]$, the value is the area under the arctangent
curve there.

$$
% caption: The region under $y=\arctan x$ from $0$ to $1$; its area $\tfrac{\pi}{4}-\tfrac{\ln 2}{2}\approx 0.439$ is what integration by parts computes.
\begin{tikzpicture}[scale=1.0,>=stealth,font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\fill[acc!12] (0,0) .. controls (1.3,1.3) and (2.7,2.35) .. (4,2.51) -- (4,0) -- cycle;
\draw[->,black] (-0.3,0) -- (5.0,0) node[right,black]{$x$};
\draw[->,black] (0,-0.3) -- (0,3.2) node[above,black]{$y$};
\draw[acc,very thick] (0,0) .. controls (1.3,1.3) and (2.7,2.35) .. (4.7,2.63);
\draw[black,dashed] (4,0) -- (4,2.51);
\node[below,black] at (4,0){$1$};
\node[acc,font=\footnotesize,anchor=east] at (3.75,1.2){$y=\arctan x$};
\node[black,font=\footnotesize] at (1.7,0.55){area};
\end{tikzpicture}
$$

## Reduction formulas

Parts can also express an integral with exponent $n$ in terms of the same
integral with a smaller exponent, producing a **reduction formula** that peels
the exponent down by recursion. Take $\int \sin^n x\,\d x$ with $u = \sin^{n-1}x$
and $\d v = \sin x\,\d x$. Then $\d u = (n-1)\sin^{n-2}x\cos x\,\d x$ and $v = -\cos x$,
so

$$
\int \sin^n x\,\d x = -\cos x\,\sin^{n-1}x + (n-1)\int \sin^{n-2}x\,\cos^2 x\,\d x.
$$

Replace $\cos^2 x = 1 - \sin^2 x$ and the integral splits, reproducing
$\int \sin^n x\,\d x$ on the right. Solving for it gives the reduction formula.[^reduction]

> **Theorem (Sine reduction).** For an integer $n \ge 2$,
> $$
> \int \sin^n x\,\d x = -\frac{1}{n}\cos x\,\sin^{n-1}x + \frac{n-1}{n}\int \sin^{n-2}x\,\d x.
> $$

Applied repeatedly, this drives the exponent down to $\int \sin x\,\d x$ when $n$
is odd, or $\int \d x$ when $n$ is even.

$$
% caption: The reduction formula peels the exponent down by two each pass, terminating at $\int\sin x\,dx$ for odd $n$ and at $\int 1\,dx$ for even $n$.
\begin{tikzpicture}[>=stealth,font=\small,
  cel/.style={draw,minimum width=17mm,minimum height=9mm,align=center,font=\footnotesize}]
\definecolor{acc}{HTML}{4A6FA5}
\node[cel,draw=acc] (o5) at (0,0) {$\int\sin^5x\,dx$};
\node[cel] (o3) at (3.6,0) {$\int\sin^3x\,dx$};
\node[cel] (o1) at (7.2,0) {$\int\sin x\,dx$};
\node[cel,draw=acc] (e4) at (0,-1.9) {$\int\sin^4x\,dx$};
\node[cel] (e2) at (3.6,-1.9) {$\int\sin^2x\,dx$};
\node[cel] (e0) at (7.2,-1.9) {$\int 1\,dx$};
\draw[->,acc,thick] (o5) -- node[above,black,font=\scriptsize]{reduce} (o3);
\draw[->,acc,thick] (o3) -- node[above,black,font=\scriptsize]{reduce} (o1);
\draw[->,acc,thick] (e4) -- node[below,black,font=\scriptsize]{reduce} (e2);
\draw[->,acc,thick] (e2) -- node[below,black,font=\scriptsize]{reduce} (e0);
\node[black,font=\scriptsize,anchor=west] at (8.2,0){odd: base is elementary};
\node[black,font=\scriptsize,anchor=west] at (8.2,-1.9){even: base is a length};
\end{tikzpicture}
$$

> **Worked example.** Evaluate $\int \sin^4 x\,\d x$ with the reduction formula.
>
> Take $n = 4$, then $n = 2$:
>
> $$
> \int \sin^4 x\,\d x = -\frac{1}{4}\cos x\,\sin^3 x + \frac{3}{4}\int \sin^2 x\,\d x,
> $$
> $$
> \int \sin^2 x\,\d x = -\frac{1}{2}\cos x\,\sin x + \frac{1}{2}\int \d x = \frac{1}{2}\bigl(x - \cos x\,\sin x\bigr).
> $$
>
> Substituting the second into the first,
>
> $$
> \int \sin^4 x\,\d x = -\frac{1}{4}\cos x\,\sin^3 x - \frac{3}{8}\cos x\,\sin x + \frac{3}{8}x + C.
> $$
>
> Between definite limits the boundary term drops at $0$ and $\tfrac{\pi}{2}$, so
> $\int_0^{\pi/2}\sin^n x\,\d x = \tfrac{n-1}{n}\int_0^{\pi/2}\sin^{n-2}x\,\d x$;
> for $n = 5$ this gives $\tfrac{4}{5}\cdot\tfrac{2}{3}\cdot 1 = \tfrac{8}{15}$.

The same pattern gives reduction formulas
for $\cos^n x$, $\tan^n x$, $\sec^n x$, and $(\ln x)^n$, all of which appear among the
[trigonometric integrals](/calculus/techniques-of-integration/trigonometric-integrals-and-substitution).

## When parts applies

| Integrand shape | Choice of $u$ | Outcome |
| --- | --- | --- |
| $x^n \cdot e^{ax}$, $x^n \sin ax$, $x^n \cos ax$ | $u = x^n$ | polynomial degree drops each pass; use the table |
| $x^n \ln x$, $x^n \tan^{-1}x$ | $u = \ln x$ or $\tan^{-1}x$ | one pass turns the transcendental factor algebraic |
| $\ln x$, $\tan^{-1}x$, $\sin^{-1}x$ alone | $u = $ the function, $\d v = \d x$ | one pass gives an elementary integral |
| $e^{ax}\sin bx$, $e^{ax}\cos bx$ | either factor, twice | cyclic; solve the resulting equation |
| $\sin^n x$, $\sec^n x$, $(\ln x)^n$ | $u = $ the $(n-1)$ power | reduction formula lowering $n$ |

Integration by parts and substitution are the two general methods. The other
techniques are these two specialized to a particular integrand shape.

[^parts]: **Stewart**, _Calculus_, §7.1 — Integration by Parts: the formula derived from the product rule, in both the $f,g$ and the $u\,\d v$ notation.
[^defparts]: **Stewart**, _Calculus_, §7.1 — the definite-integral form obtained by evaluating both sides between $a$ and $b$ with the Fundamental Theorem.
[^reduction]: **Stewart**, _Calculus_, §7.1, Example 6 — derivation of the reduction formula for $\int \sin^n x\,\d x$ by parts.
