# Integral by Parts: Indefinite Integral

How to solve the indefinite integral of a product by using the integral by parts: formula, 4 examples, and their solutions.

## Formula

The integral of a product, uv', can be solved

by using this formula.

∫ uv' dx = uv - ∫ u'v dx

This formula can be derived from

the derivative of a product formula:

[uv]' = u'v + uv'.

u'v + uv' = [uv]'

uv' = [uv]' - u'v

Integrate both sides.

Then ∫ uv' dx = uv - ∫ u'v dx.

## How to Choose u and v'

For a product of two functions in an integral,

one is u, and the other is v'.

To choose u and v' properly,

remember this order of uv':

[u]

logarithmic

polynomial

trigonometric,

exponential

[v'].

Set u = (upper function) and v' = (lower function).

u is the function

whose integral is complex.

v' is the function

whose integral is simple.

## Example∫ xe^{x} dx

xe^{x} is the product of x and e^{x}.

So solve this

by using integral by parts.

The order of uv' is

[u]

logarithmic

polynomial (x)

trigonometric

exponential (e^{x})

[v'].

So set

u = x and v' = e^{x}.

Write u = x.

Differentiate both sides.

Then u' = 1.

Derivative of a Polynomial

Write v' = e^{x}

next to u' = 1.

Integrate both sides.

Then v = e^{x}.

(You don't have to write +C in this case.)

Integral of e^{x}

Write this above v' = e^{x}.

u = x, v = e^{x}

u' = 1

Then the given integral is equal to,

uv, x⋅e^{x}

minus

integral, u'v, 1⋅e^{x} dx.

x⋅e^{x} = xe^{x}

1⋅e^{x} = e^{x}

-∫ e^{x} dx = -e^{x} + C

So

xe^{x} - e^{x} + C

is the answer.

## Example∫ x cos x dx

x cos x is the product of x and cos x.

So solve this

by using integral by parts.

The order of uv' is

[u]

logarithmic

polynomial (x)

trigonometric (cos x)

exponential

[v'].

So set

u = x and v' = cos x.

Write u = x.

Differentiate both sides.

Then u' = 1.

Write v' = cos x

next to u' = 1.

Integrate both sides.

Then v = sin x.

Integral of cos x

Write this above v' = cos x.

u = x, v = sin x

u' = 1

Then the given integral is equal to,

uv, x⋅(sin x)

minus

integral, u'v, 1⋅(sin x) dx.

x⋅(sin x) = x sin x

1⋅(sin x) = sin x

-∫ sin x dx = -(-cos x + C)

Integral of sin x

-(-cos x + C) = +cos x + C

-(+C)= -C is still a constant.

So the constant term is still +C.

So

x sin x + cos x + C

is the answer.

## Example∫ x^{2} sin x dx

x^{2} sin x is the product of x^{2} and sin x.

So solve this

by using integral by parts.

The order of uv' is

[u]

logarithmic

polynomial (x^{2})

trigonometric (sin x)

exponential

[v'].

So set u = x^{2} and v' = sin x.

Write u = x^{2}.

Differentiate both sides.

Then u' = 2x.

Write v' = sin x

next to u' = 2x.

Integrate both sides.

Then v = -cos x.

Write this above v' = sin x.

u = x^{2}, v = -cos x

u' = 2x

Then the given integral is equal to,

uv, x^{2}⋅(-cos x)

minus

integral, u'v, (2x)⋅(-cos x) dx.

x^{2}⋅(-cos x) = -x^{2} cos x

-∫ (2x)⋅(-cos x) dx = +2 ∫ x cos x dx

x cos x is the product of x and cos x.

So solve ∫ x cos x dx

by using integral by parts again.

The order of uv' is

[u]

logarithmic

polynomial (x)

trigonometric (cos x)

exponential

[v'].

So set

u = x and v' = cos x.

Write u = x.

Differentiate both sides.

Then u' = 1.

Write v' = cos x

next to u' = 1.

Integrate both sides.

Then v = sin x.

Write this above v' = cos x.

u = x, v = sin x

u' = 1

Then ∫ x cos x dx becomes

uv, x⋅sin x

minus

integral, u'v, 1⋅(sin x) dx.

x⋅(sin x) = x sin x

1⋅(sin x) = sin x

+2[x sin x - ∫ sin x dx] = +2x sin x - 2∫ sin x dx

∫ sin x dx = -cos x + C

-2(-cos x + C) = +2 cos x + C

-2⋅C = -2C is still a constant.

So just write +C.

-x^{2} cos x + 2 cos x = (-x^{2} + 2) cos x

So

2x sin x + (-x^{2} + 2) cos x + C

is the answer.

## Example∫ e^{x} sin x dx

e^{x} sin x is the product of e^{x} and sin x.

So solve this

by using integral by parts.

The order or uv' is

[u]

logarithmic

polynomial

trigonometric (sin x)

exponential (e^{x})

[v'].

So set

u = sin x and v' = e^{x}.

Write u = sin x.

Differentiate both sides.

Then u' = cos x.

Derivative of sin x

Write v' = e^{x}

next to u' = cos x.

Integrate both sides.

Then v = e^{x}.

Write this above v' = e^{x}.

u = sin x, v = e^{x}

u' = cos x

Then the given integral is equal to,

uv, (sin x)⋅e^{x}

minus

integral, u'v, (cos x)⋅e^{x} dx.

(cos x)⋅e^{x} is the product of cos x and e^{x}.

So solve ∫ (cos x)⋅e^{x} dx

by using integral by parts again.

The order of uv' is

[u]

logarithmic

polynomial

trigonometric (cos x)

exponential (e^{x})

[v'].

So set

u = cos x and v' = e^{x}.

Write u = cos x.

Differentiate both sides.

Then u' = -sin x.

Derivative of cos x

Write v' = e^{x}

next to u' = -sin x.

Integrate both sides.

Then v = e^{x}.

Write this above v' = e^{x}.

(sin x)⋅e^{x} = e^{x} sin x

u = cos x, v = e^{x}

u' = -sin x

Then ∫ (cos x)⋅e^{x} dx is equal to,

uv, (cos x)⋅e^{x}

minus

integral, u'v, (-sin x)⋅e^{x} dx.

(cos x)⋅e^{x} = e^{x} cos x

-∫(-sin x)⋅e^{x} dx = +∫ e^{x} sin x dx

-[e^{x} cos x + ∫ e^{x} sin x dx] = -e^{x} cos x - ∫ e^{x} sin x dx

(given) = e^{x} sin x - e^{x} cos x - ∫ e^{x} sin x dx

∫ e^{x} sin x dx = (given)

So (given) = e^{x} sin x - e^{x} cos x - (given).

(given) = e^{x} sin x - e^{x} cos x - (given)

Move -(given) to the left side.

Then 2(given) = e^{x} sin x - e^{x} cos x.

(given) is an indefinite integral.

So write +C.

e^{x} sin x - e^{x} cos x = e^{x}(sin x - cos x)

Common Monomial Factor

Divide both sides by 2.

Then (given) = [e^{x}/2](sin x - cos x) + C.

+C/2 is still a constant.

So the constant term is still +C.

So

[e^{x}/2](sin x - cos x) + C

is the answer.