# Integration by Parts (Part 1)

How to solve integral problems by using the integration by parts (indefinite integral): formula, proof, examples, and their solutions.

## Formula

uv' dx = uv - ∫ u'v dx

This formula is derived
from the below differential formula:
[uv]' = u'v + uv'.

You'll see the proof of the integration formula below.

## Proof

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

Product rule in differentiation

Switch both sides.

And move u'v to the right side.

Integral both sides.

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

## How to Choose u and v'

Here's the general priority
when choosing u and v'.

See the types of two terms.
The type that fits into the upper function is u,
and the type that fits into the the lower function is v'.

ln x, loga x: logarithmic functions
x, x2, ... : polynomials
sin x, cos x, ... : trigonometric functions
ex, ax: exponential functions

The upper functions' derivatives, u', are simple,
compare to their integrals.

And the lower functions' integrals, v, are still simple.

After solving some examples below,
you'll know how to use this priority.

## Example 1

x, ex

Set u = x and v' = ex.

Write u = x.
Write u' = 1.

Write v' = ex next to u' = 1.
And write v = ex next to u = x.

By writing like this,
you can avoid making mistakes.

Indefinite integration of ex

The integral of, uv', xex dx
is equal to,
uv, xex
minus the integral of, u'v, 1⋅ex dx.

## Example 2

x, cos x

Set u = x and v' = cos x.

Write u = x.
Write u' = 1.

Write v' = cos x next to u' = 1.
And write v = sin x next to u = x.

Indefinite integration of cos x

The integral of, uv', x cos x dx
is equal to,
uv, x sin x
minus the integral of, u'v, 1⋅sin x dx.

## Example 3

x2, sin x

Set u = x2 and v' = sin x.

Write u = x2.
Write u' = 2x.

Write v' = sin x next to u' = 2x.
And write v = -cos x next to u = x2.

Indefinite integration of sin x

The integral of, uv', x2 sin x dx
is equal to,
uv, x2⋅(-cos x)
minus the integral of, u'v, 2x⋅(-cos x) dx.

Use the integration by parts again on ∫ x cos x dx.

Set u = x and v' = cos x.

Write u = x.
Write u' = 1.

Write v' = cos x next to u' = 1.
And write v = sin x next to u = x.

Indefinite integration of cos x

The integral of, uv', x cos x dx
is equal to,
uv, x sin x
minus the integral of, u'v, 1⋅sin x dx.

Indefinite integration of sin x

Don't forget to write +C.

## Example 4

ex, sin x

Set u = sin x and v' = ex.

Write u = sin x.
Write u' = cos x.

Derivative of sin x

Write v' = ex next to u' = cos x.
And write v = ex next to u = sin x.

Indefinite integration of ex

The integral of, uv', (sin x)(ex) dx
is equal to,
uv, (sin x)(ex)
minus the integral of, u'v, (cos x)(ex) dx.

Use the integration by parts again on ∫ (cos x)(ex) dx.

Set u = cos x and v' = ex.

Write u = cos x.
Write u' = -sin x.

Derivative of cos x

Write v' = ex next to u' = -sin x.
And write v = ex next to u = cos x.

The integral of, uv', (cos x)(ex) dx
is equal to,
uv, (cos x)(ex)
minus the integral of, u'v, (-sin x)(ex) dx.

(given) = ex sin x - ex cos x - ∫ (sin x)(ex) dx

∫ (sin x)(ex) dx is the (given).

Then, instead of using the integration by parts again,
write the equation like this:
(given) = ex sin x - ex cos x - (given)

Move the right side's (given) to the left side.

And don't forget to write +C on the right side.

Divide both sides by 2.

Then (given) = (ex/2)(sin x - cos x) + C.