# How to Use the Formula for Integration by Parts

Integration by parts is simply the product rule reversed. The formula is as follows:

Formula

### IntegrationbyParts

 $\int u{v}^{\prime }\phantom{\rule{0.17em}{0ex}}dx=uv-\int {u}^{\prime }v\phantom{\rule{0.17em}{0ex}}dx$

Note! In exercises with integration by parts, you should choose ${e}^{x}$ as ${v}^{\prime }$ and $\mathrm{ln}\left(x\right)$ as $u$.

Example 1

$\begin{array}{llll}\hfill \int 3x{e}^{x}\phantom{\rule{0.17em}{0ex}}dx& \stackrel{\ast }{=}3x{e}^{x}-\int 3{e}^{x}\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =3x{e}^{x}-3{e}^{x}+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =3{e}^{x}\left(x-1\right)+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

*

$\begin{array}{ccccc}\hfill u& =3x\hfill & \hfill {v}^{\prime }& ={e}^{x}\hfill & \hfill \\ \hfill {u}^{\prime }& =3\hfill & \hfill v& ={e}^{x}\hfill \end{array}$

Example 2

Find the function $F$ such that ${F}^{\prime }\left(x\right)=4{x}^{3}+\frac{1}{x}$ and $F\left(1\right)=2$

 $F\left(x\right)=\int 4{x}^{3}+\frac{1}{x}\phantom{\rule{0.17em}{0ex}}dx={x}^{4}+\mathrm{ln}\phantom{\rule{-0.17em}{0ex}}|x|+C$

Furthermore, given that $F\left(1\right)=2$: $\begin{array}{llll}\hfill 2& =F\left(1\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={1}^{4}+\mathrm{ln}\phantom{\rule{-0.17em}{0ex}}|1|+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =1+0+C,\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill C& =1\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Then, $F\left(x\right)={x}^{4}+\mathrm{ln}\phantom{\rule{-0.17em}{0ex}}|x|+1$.

Example 3

Compute the integral $\int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx$

$\begin{array}{llll}\hfill \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx& =\int \mathrm{sin}x\cdot \mathrm{sin}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \stackrel{\ast }{=}-\mathrm{sin}x\mathrm{cos}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{=}+\int {\mathrm{cos}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =-\mathrm{sin}x\mathrm{cos}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{=}+\int 1-{\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =-\mathrm{sin}x\mathrm{cos}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{=}+x\int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

$\begin{array}{llll}\hfill \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx& =\int \mathrm{sin}x\cdot \mathrm{sin}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \stackrel{\ast }{=}-\mathrm{sin}x\mathrm{cos}x+\int {\mathrm{cos}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =-\mathrm{sin}x\mathrm{cos}x+\int 1-{\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =-\mathrm{sin}x\mathrm{cos}x+x-\int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

*

$\begin{array}{ccccc}\hfill u& =\mathrm{sin}x\hfill & \hfill {v}^{\prime }& =\mathrm{sin}x\hfill & \hfill \\ \hfill {u}^{\prime }& =\mathrm{cos}x\hfill & \hfill v& =-\mathrm{cos}x\hfill \end{array}$

This gives you an equation that you solve for $\int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx$:

$\begin{array}{llll}\hfill \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx& =-\mathrm{sin}x\mathrm{cos}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{=}+x\int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

$\begin{array}{cc}\frac{2\cdot \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx}{2}=\frac{-\mathrm{sin}x\mathrm{cos}x+x}{2}& \\ \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx=-\frac{1}{2}\mathrm{sin}x\mathrm{cos}x+\frac{x}{2}+C& \end{array}$

$\begin{array}{llll}\hfill \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx& =-\mathrm{sin}x\mathrm{cos}x+x-\int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 2\cdot \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx& =-\mathrm{sin}x\mathrm{cos}x+x\phantom{\rule{1em}{0ex}}|:2\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \int {\mathrm{sin}}^{2}x\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{2}\mathrm{sin}x\mathrm{cos}x+\frac{x}{2}+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Example 4

Compute $\int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx$

$\begin{array}{llll}\hfill & \phantom{=}\int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \stackrel{\ast }{=}-\frac{1}{2}{\mathrm{cos}}^{2}\left(2x\right)-\int \mathrm{sin}\left(2x\right)\mathrm{cos}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

 $\int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx\stackrel{\ast }{=}-\frac{1}{2}{\mathrm{cos}}^{2}\left(2x\right)-\int \mathrm{sin}\left(2x\right)\mathrm{cos}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx$

*

$\begin{array}{ccccc}\hfill u& =\mathrm{cos}\left(2x\right)\hfill & \hfill {v}^{\prime }& =\mathrm{sin}\left(2x\right)\hfill & \hfill \\ \hfill {u}^{\prime }& =-2\mathrm{sin}\left(2x\right)\hfill & \hfill v& =-\frac{1}{2}\mathrm{cos}\left(2x\right)\hfill \end{array}$

You now solve this expression as an equation with respect to $\int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx$:

$\begin{array}{llll}\hfill \int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{2}{\mathrm{cos}}^{2}\left(2x\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{1em}{0ex}}-\int \mathrm{sin}\left(2x\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{1em}{0ex}}\cdot \mathrm{cos}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 2\int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{2}{\mathrm{cos}}^{2}\left(2x\right)\phantom{\rule{1em}{0ex}}|÷2\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{4}{\mathrm{cos}}^{2}\left(2x\right)+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

$\begin{array}{llll}\hfill \int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{2}{\mathrm{cos}}^{2}\left(2x\right)-\int \mathrm{sin}\left(2x\right)\mathrm{cos}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 2\int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{2}{\mathrm{cos}}^{2}\left(2x\right)\phantom{\rule{2em}{0ex}}|÷2\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \int \mathrm{cos}\left(2x\right)\mathrm{sin}\left(2x\right)\phantom{\rule{0.17em}{0ex}}dx& =-\frac{1}{4}{\mathrm{cos}}^{2}\left(2x\right)+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Example 5

Compute $\int {e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)\phantom{\rule{0.17em}{0ex}}dx$

$\begin{array}{llll}\hfill & \phantom{=}\int {e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \stackrel{\ast }{=}{e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)-\int {e}^{x}\left(2x+3\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{1em}{0ex}}-\phantom{\rule{-0.17em}{0ex}}\left({e}^{x}\left(2x+3\right)-\int 2{e}^{x}\phantom{\rule{0.17em}{0ex}}dx\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \stackrel{\ast \ast }{=}{e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{1em}{0ex}}-{e}^{x}\left(2x+3\right)+2{e}^{x}+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+x-5\right)+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

$\begin{array}{llll}\hfill \int {e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)\phantom{\rule{0.17em}{0ex}}dx& \stackrel{\ast }{=}{e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)-\int {e}^{x}\left(2x+3\right)\phantom{\rule{0.17em}{0ex}}dx\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)-\phantom{\rule{-0.17em}{0ex}}\left({e}^{x}\left(2x+3\right)-\int 2{e}^{x}\phantom{\rule{0.17em}{0ex}}dx\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \stackrel{\ast \ast }{=}{e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+3x-4\right)-{e}^{x}\left(2x+3\right)+2{e}^{x}+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={e}^{x}\phantom{\rule{-0.17em}{0ex}}\left({x}^{2}+x-5\right)+C\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

*

$\begin{array}{ccccc}\hfill u& ={x}^{2}+3x-4\hfill & \hfill {v}^{\prime }& ={e}^{x}\hfill & \hfill \\ \hfill {u}^{\prime }& =2x+3\hfill & \hfill v& ={e}^{x}\hfill \end{array}$

**

$\begin{array}{ccccc}\hfill z& =2x+3\hfill & \hfill {w}^{\prime }& ={e}^{x}\hfill & \hfill \\ \hfill {z}^{\prime }& =2\hfill & \hfill w& ={e}^{x}\hfill \end{array}$