Steply

Integration by parts

Calculus 2 · 21 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Choose u and dv
  2. Find du and v
  3. Use the rule
  4. Parts again
  5. Find du and v
  6. Use the rule
  7. The new integral
  8. Check

The steps for Integrate ∫ x^2 e^x dx. Every solution names its steps, so you always know what comes next.

Worked examples

Integrate ∫ x e^x dx Easy

The question

Question: find the integral of x eˣ.

∫ xex dx =

1 Choose u and dv

Choose u = x: its derivative is simpler, just a number.

dv is the rest: eˣ dx, which we can integrate.

u = x, dv = ex dx

2 Find du and v

du: the derivative of u, times dx.

v: the integral of dv.

e to the x stays e to the x.

du = 1 dx, v = ex

3 Use the rule

The rule: the integral of u dv is u v, minus the integral of v du.

It comes from the product rule, backwards.

∫ u dv = uv − ∫ v du

u times v, minus the integral of v times du.

= xex − ∫ ex dx

4 The new integral

The new integral is easy: just a number times e to a power.

= xex − ex

Careful!

It is u v minus the integral of v du.

Not plus!

Careful: not uv + ∫ v du ✗

Open the bracket: a minus in front of a bracket changes the sign of every part inside.

Add C.

So the answer is x eˣ − eˣ + C.

= xex − ex + C

5 Check

Let's check: take the derivative of our answer.

The product rule on each term: the first's slope times the second, plus the first times the second's slope.

derivative: ex + xex − ex

The other terms cancel, and we get x eˣ: the question again.

Right!

= xex

Let's look back.

First: choose u and dv.

Then: find du and v.

Then: use the rule.

Then: the new integral.

Last: check.

Answer
= xex − ex + C

▶ Watch it solved

Integrate ∫ x sin(2x) dx Medium

The question

Question: find the integral of x sin(2x).

∫ x sin(2x) dx =

1 Choose u and dv

Choose u = x: its derivative is simpler, just a number.

dv is the rest: sin(2x) dx, which we can integrate.

u = x, dv = sin(2x) dx

2 Find du and v

du: the derivative of u, times dx.

v: the integral of dv.

sin gives minus cos, over 2.

du = 1 dx, v = −12 cos(2x)

3 Use the rule

The rule: the integral of u dv is u v, minus the integral of v du.

It comes from the product rule, backwards.

∫ u dv = uv − ∫ v du

u times v, minus the integral of v times du.

= −12x cos(2x) − ∫ (−12 cos(2x)) dx

4 The new integral

The new integral is easy: just a number times cos.

cos integrates to sin.

= −12x cos(2x) − (−14 sin(2x))

Careful!

It is u v minus the integral of v du.

Not plus!

Careful: not uv + ∫ v du ✗

Open the bracket: a minus in front of a bracket changes the sign of every part inside.

Add C.

So the answer is −1/2 × x cos(2x) + 1/4 × sin(2x) + C.

= −12x cos(2x) + 14 sin(2x) + C

5 Check

Let's check: take the derivative of our answer.

The product rule on each term: the first's slope times the second, plus the first times the second's slope.

derivative: −12 cos(2x) + x sin(2x) + 12 cos(2x)

The other terms cancel, and we get x sin(2x): the question again.

Right!

= x sin(2x)

Let's look back.

First: choose u and dv.

Then: find du and v.

Then: use the rule.

Then: the new integral.

Last: check.

Answer
= −12x cos(2x) + 14 sin(2x) + C

▶ Watch it solved

Integrate ∫ x^2 e^x dx Harder

The question

Question: find the integral of x² eˣ.

∫ x2ex dx =

1 Choose u and dv

Choose u = x²: its derivative is simpler.

dv is the rest: eˣ dx, which we can integrate.

u = x2, dv = ex dx

2 Find du and v

du: the derivative of u, times dx.

v: the integral of dv.

e to the x stays e to the x.

du = 2x dx, v = ex

3 Use the rule

The rule: the integral of u dv is u v, minus the integral of v du.

It comes from the product rule, backwards.

∫ u dv = uv − ∫ v du

u times v, minus the integral of v times du.

= x2ex − ∫ 2xex dx

Careful!

It is u v minus the integral of v du.

Not plus!

Careful: not uv + ∫ v du ✗

4 Parts again

The new integral has x in it again: parts again.

Choose u = 2x: its derivative is simpler, just a number.

dv is the rest: eˣ dx, which we can integrate.

u = 2x, dv = ex dx

5 Find du and v

du: the derivative of u, times dx.

v: the integral of dv.

e to the x stays e to the x.

du = 2 dx, v = ex

6 Use the rule

u times v, minus the integral of v times du.

∫ 2xex dx = 2xex − ∫ 2ex dx

7 The new integral

The new integral is easy: just a number times e to a power.

= 2xex − 2ex

Open the bracket.

= 2xex − 2ex

Put that back in its place.

= x2ex − (2xex − 2ex)

Open the bracket: a minus in front of a bracket changes the sign of every part inside.

Add C.

So the answer is x² eˣ − 2x eˣ + 2eˣ + C.

= x2ex − 2xex + 2ex + C

8 Check

Let's check: take the derivative of our answer.

The product rule on each term: the first's slope times the second, plus the first times the second's slope.

derivative: 2xex + x2ex − 2ex − 2xex + 2ex

The other terms cancel, and we get x² eˣ: the question again.

Right!

= x2ex

Let's look back.

First: choose u and dv.

Then: find du and v.

Then: use the rule.

Then: parts again.

Then: find du and v.

Then: use the rule.

Then: the new integral.

Last: check.

Answer
= x2ex − 2xex + 2ex + C

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. ∫ x e^x dx
    Answer
    = xex − ex + C
  2. ∫ 2x cos x dx
    Answer
    = 2x sin x + 2 cos x + C
  3. ∫ x sin x dx
    Answer
    = −x cos x + sin x + C
  4. ∫ ln x dx
    Answer
    = x ln x − x + C
  5. ∫ 2x e^x dx
    Answer
    = 2xex − 2ex + C
  6. ∫ x e^(2x) dx
    Answer
    = 12xe2x − 14e2x + C
  7. ∫ 3x cos x dx
    Answer
    = 3x sin x + 3 cos x + C
  8. ∫ x e^(-x) dx
    Answer
    = −xe−x − e−x + C

Medium

  1. ∫ x sin(2x) dx
    Answer
    = −12x cos(2x) + 14 sin(2x) + C
  2. ∫ x ln x dx
    Answer
    = 12x2 ln x − 14x2 + C
  3. ∫ (x + 1)e^x dx
    Answer
    = xex + C
  4. ∫ x^2 ln x dx
    Answer
    = 13x3 ln x − 19x3 + C
  5. ∫ 4x cos(2x) dx
    Answer
    = 2x sin(2x) + cos(2x) + C
  6. ∫ (x - 2)e^x dx
    Answer
    = xex − 3ex + C
  7. ∫ from 0 to 1 of x e^x dx
    Answer
    = 1
  8. ∫ from 1 to e of x ln x dx
    Answer
    = e2 + 14 ≈ 2.097

Harder

  1. ∫ x^2 e^x dx
    Answer
    = x2ex − 2xex + 2ex + C
  2. ∫ x^2 cos x dx
    Answer
    = x2 sin x + 2x cos x − 2 sin x + C
  3. ∫ x^2 sin x dx
    Answer
    = −x2 cos x + 2x sin x + 2 cos x + C
  4. ∫ from 0 to 2 of x e^x dx
    Answer
    = e2 + 1 ≈ 8.389
  5. ∫ 3x^2 ln x dx
    Answer
    = x3 ln x − 13x3 + C