# Integration by Parts

## Solved Problems

### Example 9.

Compute the integral $\int {{x^2}{e^x}dx}.$

Solution.

Let

$u = {x^2},\;\;dv = {e^x}dx.$

Then

$du = 2xdx,\;\;v = \int {{e^x}dx} = {e^x},$

The integral is written as

$\int {{x^2}{e^x}dx} = {x^2}{e^x} - \int {2x{e^x}dx} = {x^2}{e^x} - 2\int {x{e^x}dx} .$

We calculate the last integral by repeated integration by parts. Choosing

$u = x,\;\;dv = {e^x}dx,$

we obtain

$du = dx,\;\;v = \int {{e^x}dx} = {e^x},$

so

$\int {{x^2}{e^x}dx} = {x^2}{e^x} - 2\int {x{e^x}dx} = {x^2}{e^x} - 2\left( {x{e^x} - \int {{e^x}dx} } \right) = {x^2}{e^x} - 2\left( {x{e^x} - {e^x}} \right) + C = {x^2}{e^x} - 2x{e^x} + 2{e^x} + C = {e^x}\left( {{x^2} - 2x + 2} \right) + C.$

### Example 10.

Calculate the integral $\int {\arcsin xdx}.$

Solution.

Use integration by parts: $$u = \arcsin x,$$ $$dv = dx.$$ Then

$du = \frac{d}{{dx}}\arcsin x = \frac{{dx}}{{\sqrt {1 - {x^2}} }}, v = \int {dx} = x,$

and the integral becomes

$\int {\arcsin xdx} = x\arcsin x - \int {\frac{x}{{\sqrt {1 - {x^2}} }}dx}.$

To calculate the new integral, we substitute $$w = 1 - {x^2}.$$ In this case,

$dw = - 2xdx, xdx = - \frac{{dw}}{2},$

so that the integral in the right side is

$\int {\frac{x}{{\sqrt {1 - {x^2}} }}dx} = \int {\frac{{\left( { - \frac{{dw}}{2}} \right)}}{{\sqrt w }}} = - \int {\frac{{dw}}{{2\sqrt w }}} = - \sqrt w + C = - \sqrt {1 - {x^2}} + C.$

The result is

$\int {\arcsin xdx} = x\arcsin x - \left( { - \sqrt {1 - {x^2}} } \right) + C = x\arcsin x + \sqrt {1 - {x^2}} + C.$

### Example 11.

Find the integral $\int {\arctan xdx}.$

Solution.

According to the ILATE rule, let

$u = \arctan x,\;\;dv = dx.$

Then

$du = \frac{{dx}}{{1 + {x^2}}},\;\;v = x,$

and

$I = \int {\arctan xdx} = x\arctan x - \int {\frac{{xdx}}{{1 + {x^2}}}} .$

We use integration by substitution to find the last integral:

$t = {x^2} + 1,\;\; \Rightarrow dt = 2xdx,\;\; \Rightarrow xdx = \frac{{dt}}{2},$

so

$\int {\frac{{xdx}}{{1 + {x^2}}}} = \int {\frac{{\frac{{dt}}{2}}}{t}} = \frac{1}{2}\int {\frac{{dt}}{t}} = \frac{1}{2}\ln \left| t \right| = \frac{1}{2}\ln \left| {1 + {x^2}} \right| = \frac{1}{2}\ln \left( {1 + {x^2}} \right).$

Hence, the original integral is given by

$I = x\arctan x - \frac{1}{2}\ln \left( {1 + {x^2}} \right) + C.$

### Example 12.

Find the integral $\int {{e^x}\sin xdx}.$

Solution.

We use integration by parts:

$\int {udv} = uv - \int {vdu} .$

Let $$u = {e^x},$$ $$dv = \sin xdx.$$ Then

$du = {e^x}dx, v = \int {\sin xdx} = - \cos x,$

so the integral can be written in the form:

$\int {{e^x}\sin xdx} = - {e^x}\cos x + \int {{e^x}\cos xdx} .$

Apply integration by parts one more time. Now let $$u = {e^x},$$ $$dv = \cos xdx.$$ Hence,

$du = {e^x}dx, v = \int {\cos xdx} = \sin x,$

so that the integral we started with is

$\int {{e^x}\sin xdx} = - {e^x}\cos x + \int {{e^x}\cos xdx} = - {e^x}\cos x + {e^x}\sin x - \int {{e^x}\sin xdx}.$

Solving this equation for this integral, we obtain

$2\int {{e^x}\sin xdx} = {e^x}\sin x - {e^x}\cos x\;\;\;\text{or}\;\;\;\int {{e^x}\sin xdx} = \frac{{{e^x}\left( {\sin x - \cos x} \right)}}{2} + C.$

### Example 13.

Find the integral $\int {{e^{ - x}}\sin xdx}.$

Solution.

We use integration by parts. Let

$u = \sin x,\;\;dv = {e^{ - x}}dx.$

Then

$du = \cos xdx,\;\;v = \int {{e^{ - x}}dx} = - {e^{ - x}},$

so that the integral is written as

$\int {{e^{ - x}}\sin xdx} = - {e^{ - x}}\sin x - \int {\left( { - {e^{ - x}}} \right)\cos xdx} = - {e^{ - x}}\sin x + \int {{e^{ - x}}\cos xdx} .$

The new integral in the right-hand side can be evaluated by repeated integration by parts. We choose

$u = \cos x,\;\;dv = {e^{ - x}}dx.$

Hence

$du = - \sin xdx,\;\;v = \int {{e^{ - x}}dx} = - {e^{ - x}}.$

Then the original integral is expressed in the form

$\int {{e^{ - x}}\sin xdx} = - {e^{ - x}}\sin x + \int {{e^{ - x}}\cos xdx} = - {e^{ - x}}\sin x + \Bigl[ { - {e^{ - x}}\cos x - \int {\left( { - {e^{ - x}}} \right)\left( { - \sin x} \right)dx} } \Bigr] = - {e^{ - x}}\sin x - {e^{ - x}}\cos x - \int {{e^{ - x}}\sin xdx} .$

We obtain the equation for our integral $$\int {{e^{ - x}}\sin xdx} .$$ Solving it, we find that

$\int {{e^{ - x}}\sin xdx} = - \frac{{{e^{ - x}}}}{2}\left( {\sin x + \cos x} \right).$

### Example 14.

Compute the integral $\int {{{\sin }^2}xdx}.$

Solution.

Let

$u = {\sin ^2}x,\;\;dv = dx.$

Then

$du = 2\sin x\cos xdx = \sin 2xdx,\;\;v = \int {dx} = x.$

Integrating by parts, we get

$I = \int {{{\sin }^2}xdx} = x\,{\sin ^2}x - \int {x\sin 2xdx} .$

We evaluate the integral in the right-hand side by repeated integration by parts. Choosing

$u = x,\;\;dv = \sin 2xdx,$

we have

$du = dx,\;\;v = \int {\sin 2xdx} = - \frac{1}{2}\cos 2x.$

So, the last integral is given by

$\int {x\sin 2xdx} = - \frac{x}{2}\cos 2x - \int {\left( { - \frac{1}{2}\cos 2x} \right)dx} = - \frac{x}{2}\cos 2x + \frac{1}{2}\int {\cos 2xdx} = - \frac{x}{2}\cos 2x + \frac{1}{2} \cdot \frac{1}{2}\sin 2x + C = - \frac{x}{2}\cos 2x + \frac{1}{4}\sin 2x + C.$

Hence, the initial integral is written as

$I = x\,{\sin ^2}x - \int {x\sin 2xdx} = x\,{\sin ^2}x + \frac{x}{2}\cos 2x - \frac{1}{4}\sin 2x + C.$

We can simplify this expression using the trig identities

$\cos 2x = {\cos ^2}x - {\sin ^2}x,\;\;{\sin ^2}x + {\cos^2}x = 1.$

This yields:

$I = x\,{\sin ^2}x + \frac{x}{2}\left( {{{\cos }^2}x - {{\sin }^2}x} \right) - \frac{1}{4}\sin 2x + C = x\,{\sin ^2}x + \frac{x}{2}{\cos ^2}x - \frac{x}{2}{\sin ^2}x - \frac{1}{4}\sin 2x + C = \frac{x}{2}\left( {{{\sin }^2}x + {{\cos }^2}x} \right) - \frac{1}{4}\sin 2x + C = \frac{x}{2} - \frac{1}{4}\sin 2x + C.$

### Example 15.

Compute the integral $\int {{{\cos }^2}xdx}.$

Solution.

We use integration by part. So let

$u = {\cos ^2}x,\;\;dv = dx.$

Then

$du = -2\cos x\sin xdx = -\sin 2xdx,\;\;v = \int {dx} = x.$

The integral becomes equal

$I = \int {{{\cos }^2}xdx} = x\,{\cos ^2}x - \int {x\left( { - \sin 2x} \right)dx} = x\,{\cos ^2}x + \int {x\sin 2xdx} .$

The last integral can be evaluated by repeated integration by parts. Let

$u = x,\;\;dv = \sin 2xdx.$

Hence

$du = dx,\;\;v = \int {\sin 2xdx} = - \frac{1}{2}\cos 2x,$

and

$\int {x\sin 2xdx} = - \frac{x}{2}\cos 2x - \int {\left( { - \frac{1}{2}\cos 2x} \right)dx} = - \frac{x}{2}\cos 2x + \frac{1}{2}\int {\cos 2xdx} = - \frac{x}{2}\cos 2x + \frac{1}{2} \cdot \frac{1}{2}\sin 2x + C = - \frac{x}{2}\cos 2x + \frac{1}{4}\sin 2x + C.$

Consequently, the initial integral can be written in the form

$I = x\,{\cos^2}x + \int {x\sin 2xdx} = x\,{\cos^2}x - \frac{x}{2}\cos 2x + \frac{1}{4}\sin 2x + C.$

We can simplify this expression using the trig identities

$\cos 2x = {\cos ^2}x - {\sin ^2}x,\;\;{\sin ^2}x + {\cos^2}x = 1.$

This gives:

$I = x\,{\cos^2}x - \frac{x}{2}\left( {{{\cos }^2}x - {{\sin }^2}x} \right) + \frac{1}{4}\sin 2x + C = x\,{\cos^2}x - \frac{x}{2}{\cos ^2}x + \frac{x}{2}{\sin ^2}x + \frac{1}{4}\sin 2x + C = \frac{x}{2}\left( {{{\cos }^2}x + {{\sin }^2}x} \right) + \frac{1}{4}\sin 2x + C = \frac{x}{2} + \frac{1}{4}\sin 2x + C.$

### Example 16.

Find a reduction formula for $\int {{{\sin }^n}xdx} , n \ge 2.$

Solution.

We apply integration by parts: $$\int {udv}$$ $$= uv - \int {vdu}.$$ Let $$u = {\sin ^{n - 1}}x,$$ $$dv = \sin xdx.$$ Then

$\int {udv} = uv - \int {vdu}.$

Let $$u = {\sin ^{n - 1}}x,$$ $$dv = \sin xdx.$$ Then

$du = \frac{d}{{dx}}{\sin ^{n - 1}}x = \left( {n - 1} \right){\sin ^{n - 2}}x\cos xdx,\;\;\;v = \int {\sin xdx} = - \cos x.$

Hence,

$\int {{{\sin }^n}xdx} = - \cos x\,{\sin ^{n - 1}}x - \int {\left( { - \cos x} \right)\left( {n - 1} \right)\,{{\sin }^{n - 2}}x\cos x}dx = - \cos x\,{\sin ^{n - 1}}x - \int {\left( {n - 1} \right)\,{{\sin }^{n - 2}}x\,{{\cos }^2}xdx} = - \cos x\,{\sin ^{n - 1}}x + \int {\left( {n - 1} \right)\,{{\sin }^{n - 2}}x\left( {1 - {{\sin }^2}x} \right)dx} = - \cos x\,{\sin ^{n - 1}}x + \left( {n - 1} \right)\int {{{\sin }^{n - 2}}xdx} - \left( {n - 1} \right)\int {{{\sin }^n}xdx} .$

Solve the equation for $$\int {{{\sin }^n}xdx}.$$ As a result, we obtain

$\int {{{\sin }^n}xdx} + \left( {n - 1} \right)\int {{{\sin }^n}xdx} = - \cos x\,{\sin ^{n - 1}}x + \left( {n - 1} \right)\int {{{\sin }^{n - 2}}xdx} ,\;\; \Rightarrow n\int {{{\sin }^n}xdx} = \left( {n - 1} \right)\int {{{\sin }^{n - 2}}xdx} - \cos x\,{\sin ^{n - 1}}x,\;\; \Rightarrow \int {{{\sin }^n}xdx} = \frac{{n - 1}}{n}\int {{{\sin }^{n - 2}}xdx} - \frac{{\cos x\,{{\sin }^{n - 1}}x}}{n}.$