# Integration by Parts: Formula, LIATE and Worked Examples

> Master integration by parts: the formula, how LIATE picks u, the tabular shortcut, the looping e^x sin x trick, and fully worked examples.

Source: https://practicecalculus.com/blog/integration-by-parts
Updated: 2026-10-08

## Key takeaways

- Integration by parts reverses the product rule: $\int u\,dv = uv - \int v\,du$.
- Use LIATE (Logarithmic, Inverse trig, Algebraic, Trig, Exponential) to choose $u$: pick whichever type comes first.
- When $u$ is a polynomial, the tabular method finishes repeated integration by parts in one table.
- If the original integral reappears after two rounds, treat it as an unknown and solve for it algebraically.

U-substitution handles $\int 2x e^{x^2}\,dx$ easily. But change it to $\int x e^x\,dx$ and no substitution helps, because the two factors have nothing to do with each other. **Integration by parts** is built for exactly this situation: a product of two different kinds of functions.

## What is integration by parts?

Integration by parts is the **product rule in reverse**. The product rule says $(uv)' = u'v + uv'$. Integrate both sides and rearrange, and you get the integration by parts formula:

$$\int u\,dv = uv - \int v\,du$$

Here $u$ is a function you will **differentiate** (to get $du$), and $dv$ is the part you will **integrate** (to get $v$). The formula trades the original integral $\int u\,dv$ for a new one, $\int v\,du$. The whole game is choosing $u$ and $dv$ so the new integral is easier.

For definite integrals the same formula reads

$$\int_a^b u\,dv = \Big[uv\Big]_a^b - \int_a^b v\,du.$$

## When to use integration by parts

Reach for parts after you have ruled out a simpler [u-substitution](/blog/u-substitution). Good signs that parts is the right tool:

- The integrand is a **product of two different kinds of function**, such as a polynomial times an exponential or a polynomial times a trig function.
- The integrand is a **single function that is easy to differentiate but hard to integrate**, such as $\ln x$, $\arctan x$ or $\arcsin x$.
- Neither factor is the derivative of something inside the other. (If it were, substitution would work.)

## How to choose u: the LIATE rule

A good $u$ gets **simpler** when you differentiate it, and a good $dv$ must be something you **can integrate**. The LIATE rule ranks function types. Choose $u$ to be whichever factor appears first:

| Letter | Type              | Examples                       |
| ------ | ----------------- | ------------------------------ |
| L      | Logarithmic       | $\ln x$, $\log_2 x$            |
| I      | Inverse trig      | $\arctan x$, $\arcsin x$       |
| A      | Algebraic         | $x$, $x^2$, $3x + 1$           |
| T      | Trigonometric     | $\sin x$, $\cos 2x$            |
| E      | Exponential       | $e^x$, $e^{3x}$, $2^x$         |

Why this order? Logs and inverse trig functions are hard to integrate but have simple derivatives, so they belong in $u$. Exponentials and sines are just as easy to integrate as to differentiate, so they make a natural $dv$.

> **Tip:** LIATE is a strong guideline, not a law. If your choice makes the new integral worse, swap $u$ and $dv$ and try again.

## Worked example 1: x times e^x

Evaluate $\int x e^x\,dx$.

**Step 1. Choose $u$ and $dv$.** Algebraic beats exponential, so $u = x$ and $dv = e^x\,dx$.

**Step 2. Compute $du$ and $v$.** $du = dx$ and $v = e^x$.

**Step 3. Apply the formula.**

$$\int x e^x\,dx = x e^x - \int e^x\,dx$$

**Step 4. Finish the easier integral.**

$$\int x e^x\,dx = x e^x - e^x + C = e^x(x - 1) + C$$

**Check:** the derivative of $e^x(x-1)$ is $e^x(x-1) + e^x = x e^x$. Correct.

If you had chosen $u = e^x$ and $dv = x\,dx$ instead, the new integral would be $\int \tfrac{x^2}{2}e^x\,dx$, which is worse. That is LIATE saving you.

## Worked example 2: x times cos x

Evaluate $\int x\cos x\,dx$.

**Step 1.** $u = x$ (algebraic), $dv = \cos x\,dx$ (trig).

**Step 2.** $du = dx$, $v = \sin x$.

**Step 3.**

$$\int x\cos x\,dx = x\sin x - \int \sin x\,dx = x\sin x + \cos x + C$$

Watch the sign: $\int \sin x\,dx = -\cos x$, and subtracting it gives $+\cos x$.

## Worked example 3: the integral of ln x

Evaluate $\int \ln x\,dx$.

There seems to be only one factor, but you can always write $dv = dx$.

**Step 1.** $u = \ln x$, $dv = dx$.

**Step 2.** $du = \frac1x\,dx$, $v = x$.

**Step 3.**

$$\int \ln x\,dx = x\ln x - \int x\cdot\frac1x\,dx = x\ln x - \int 1\,dx = x\ln x - x + C$$

The same trick handles $\int \arctan x\,dx$. With $u = \arctan x$ and $dv = dx$, you get $x\arctan x - \int \frac{x}{1+x^2}\,dx$, and a quick [u-substitution](/blog/u-substitution) finishes it:

$$\int \arctan x\,dx = x\arctan x - \tfrac12\ln(1+x^2) + C$$

## Worked example 4: a definite integral

Evaluate $\int_1^e \ln x\,dx$.

Using the antiderivative from example 3:

$$\int_1^e \ln x\,dx = \Big[x\ln x - x\Big]_1^e = (e\cdot 1 - e) - (1\cdot 0 - 1) = 0 - (-1) = 1$$

```graph
title: 'Area under y = ln x from x = 1 to x = e equals 1'
caption: 'Integration by parts shows the shaded area is exactly $\int_1^e \ln x\,dx = 1$.'
x: [0, 4]
y: [-1.5, 1.8]
functions:
  - expr: ln(x)
    label: y = ln x
shade: {expr: ln(x), from: 1, to: 2.71828}
points:
  - [2.71828, 1, '(e, 1)']
vertical:
  - {x: 2.71828, label: 'x = e'}
```

## The tabular method for repeated integration by parts

When $u$ is a polynomial like $x^3$, you would need to apply parts three times, each time reducing the power by one. The **tabular method** (sometimes called the DI method) does all the rounds at once.

1. In the left column, write $u$ and keep **differentiating** until you reach $0$.
2. In the right column, write $dv$ and keep **integrating**, one row per derivative.
3. Draw diagonals from each left entry to the right entry one row down, with signs alternating $+, -, +, -, \dots$
4. Add up the diagonal products.

### Worked example 5: tabular method for x³ sin x

Evaluate $\int x^3\sin x\,dx$.

| Sign | Differentiate $u$ | Integrate $dv$ |
| ---- | ----------------- | -------------- |
| $+$  | $x^3$             | $\sin x$       |
| $-$  | $3x^2$            | $-\cos x$      |
| $+$  | $6x$              | $-\sin x$      |
| $-$  | $6$               | $\cos x$       |
|      | $0$               | $\sin x$       |

Multiply each left entry by the right entry one row below it, using the sign in its row:

$$\int x^3\sin x\,dx = (+)x^3(-\cos x) + (-)3x^2(-\sin x) + (+)6x(\cos x) + (-)6(\sin x)$$

$$= -x^3\cos x + 3x^2\sin x + 6x\cos x - 6\sin x + C$$

**Check:** differentiating gives $-3x^2\cos x + x^3\sin x + 6x\sin x + 3x^2\cos x + 6\cos x - 6x\sin x - 6\cos x = x^3\sin x$. Everything else cancels.

The tabular method works smoothly whenever $u$ eventually differentiates to zero and $dv$ is easy to integrate over and over, so polynomial times $e^{ax}$, $\sin(ax)$ or $\cos(ax)$.

## The looping case: e^x sin x

Some integrals never reduce to zero. Instead, after two rounds of parts, the **original integral comes back**. That is not a dead end. It is the solution.

### Worked example 6: integrate e^x sin x

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

**Step 1. First round.** Let $u = \sin x$, $dv = e^x\,dx$. Then $du = \cos x\,dx$, $v = e^x$:

$$I = e^x\sin x - \int e^x\cos x\,dx$$

**Step 2. Second round, same pattern.** In the new integral let $u = \cos x$, $dv = e^x\,dx$. Then $du = -\sin x\,dx$, $v = e^x$:

$$\int e^x\cos x\,dx = e^x\cos x + \int e^x\sin x\,dx = e^x\cos x + I$$

**Step 3. Substitute back.**

$$I = e^x\sin x - \left(e^x\cos x + I\right) = e^x\sin x - e^x\cos x - I$$

**Step 4. Solve for $I$.** Add $I$ to both sides: $2I = e^x(\sin x - \cos x)$, so

$$\int e^x\sin x\,dx = \frac{e^x(\sin x - \cos x)}{2} + C$$

**Check:** the derivative is $\tfrac12\left[e^x(\sin x - \cos x) + e^x(\cos x + \sin x)\right] = \tfrac12\cdot 2e^x\sin x = e^x\sin x$.

> **Tip:** in the second round, keep the same type of function as $u$ (trig both times). If you switch and pick $u = e^x$, you will undo the first step and end up with $I = I$.

## Common integration by parts mistakes

1. **Choosing $u$ backward.** Setting $u = e^x$ in $\int x e^x\,dx$ makes the integral harder. Follow LIATE.
2. **Sign errors.** The formula has a minus sign, and $\int\sin x\,dx = -\cos x$ adds another. Most wrong answers come from here.
3. **Forgetting $v$ in the $uv$ term.** It is $uv$, not $u\,dv$.
4. **Missing the alternating signs in the tabular method.** Every other diagonal is negative.
5. **Switching types in the loop.** In $\int e^x\sin x\,dx$, stay with trig as $u$ both times.
6. **Dropping $+C$** or forgetting to evaluate $uv$ at both bounds in a definite integral.

## Quick reference

| Integral                 | Choose $u$  | Result                                         |
| ------------------------ | ----------- | ---------------------------------------------- |
| $\int x e^x\,dx$         | $x$         | $e^x(x-1) + C$                                 |
| $\int x\cos x\,dx$       | $x$         | $x\sin x + \cos x + C$                         |
| $\int x\sin x\,dx$       | $x$         | $-x\cos x + \sin x + C$                        |
| $\int \ln x\,dx$         | $\ln x$     | $x\ln x - x + C$                               |
| $\int \arctan x\,dx$     | $\arctan x$ | $x\arctan x - \frac12\ln(1+x^2) + C$           |
| $\int e^x\sin x\,dx$     | $\sin x$    | $\frac12 e^x(\sin x - \cos x) + C$             |
| $\int e^x\cos x\,dx$     | $\cos x$    | $\frac12 e^x(\sin x + \cos x) + C$             |

## Practice until LIATE is automatic

Integration by parts rewards repetition more than any other technique: the formula is short, but choosing $u$ well and keeping the signs straight only becomes second nature with practice. The interactive lesson below gives you instant feedback on each step, so you can catch a flipped sign before it becomes a habit.

## Frequently asked questions

### What is the integration by parts formula?

The formula is $\int u\,dv = uv - \int v\,du$. You split the integrand into a part $u$ that you differentiate and a part $dv$ that you integrate, and the hope is that the new integral $\int v\,du$ is easier than the original.

### How do you choose u and dv?

Use the LIATE order: Logarithmic, Inverse trig, Algebraic (polynomials), Trig, Exponential. Whichever factor appears earliest in that list becomes $u$, and everything else, including $dx$, becomes $dv$. The goal is a $u$ that gets simpler when differentiated and a $dv$ you can actually integrate.

### When should you use integration by parts instead of u-substitution?

Try u-substitution first. If the integrand is a product of two unrelated functions, such as $x e^x$ or $x\cos x$, where neither factor is the derivative of something inside the other, integration by parts is usually the right tool. It also handles single functions like $\ln x$ and $\arctan x$.

### What is the tabular method of integration by parts?

The tabular method is a shortcut for integrals like $\int x^3\sin x\,dx$ where $u$ is a polynomial. You list derivatives of $u$ down to zero in one column, repeated antiderivatives of $dv$ in another, then multiply diagonally with alternating signs $+, -, +, -$.

### What do you do when integration by parts goes in a circle?

For integrals like $\int e^x\sin x\,dx$, applying parts twice brings back the original integral. Call it $I$, write the equation $I = (\text{stuff}) - I$, and solve: $2I = \text{stuff}$, so $I$ is half of it, plus $C$.
