# Integration by Parts

Page
Integration by Parts – HMC Calculus Tutorial

We will use the Product Rule for derivatives to derive a powerful integration formula:

• Start with $(f(x)g(x))’=f(x)g'(x)+f'(x)g(x)$.
• Integrate both sides to get $\displaystyle f(x)g(x)=\int\! f(x)g'(x)\, dx +\int\! f'(x)g(x)\, dx$. We need not include a constant of integration on the left, since the integrals on the right will also have integration constants.
• Solve for $\displaystyle\int\! f(x)g'(x)\, dx$, obtaining $\int f(x)g'(x)\, dx=f(x)g(x)-\int f'(x)g(x)\, dx.$

This formula frequently allows us to compute a difficult integral by computing a much simpler integral. We often express the Integration by Parts formula as follows:

Let $\begin{array}{ll} u = f(x)\qquad\qquad & dv = g'(x)\, dx\\ du = f'(x)\, dx & v = g(x) \end{array}$ Then the formula becomes $\int u\, dv=uv-\int v\, du.$ To integrate by parts, strategically choose $u$, $dv$ and then apply the formula.

###### Example

Let’s evaluate $\displaystyle\int\! xe^x\, dx$.

Let $\begin{array}{ll} u = x \qquad\qquad & dv = e^x\, dx\\ du = dx & v = e^x \end{array}$ Then by integration by parts, \begin{eqnarray*} \int xe^x&=&xe^x-\int e^x\, dx\\ &=&xe^x-e^x+C. \end{eqnarray*}

In integrating $\displaystyle\int\! xe^x\, dx$, what if we had chosen $u$, $dv$ as follows? $\begin{array}{ll} u = e^x\qquad\qquad & dv = x\, dx\\ du = e^x\, dx & v = \frac{1}{2}x^2 \end{array}$ Then by integration by parts, $\int xe^x=\frac{1}{2}x^2e^x-\int \frac{1}{2}x^2e^x\, dx.$ But $\displaystyle\int\! \frac{1}{2}x^2e^x\, dx$ is even more complicated than the original integral!

It takes intuition and practice to make a good choice of $u$ and $dv$!

We may use the method of integration by parts to obtain a reduction formula for $x^ne^x\, dx$: $\int x^ne^x\, dx=x^ne^x-n\int x^{n-1}e^x\, dx.$ What would be good choices for $u$ and $dv$ to obtain this formula?

Reduction formulas may also be found for integrals of trigonometric functions such as $\displaystyle\int\! \cos^n(x)\, dx$.

Integration by parts “works” on definite integrals as well: $\int^b_a u\, dv=\left.uv\right|^b_a-\int^b_a v\, du.$

###### Example

We will evaluate $\displaystyle\int^1_0\! \arctan (x)\, dx$.

Let $\begin{array}{ll} u = \arctan(x) \qquad\qquad & dv = dx\\ du = \displaystyle\frac{1}{1+x^2}\, dx & v = x \end{array}$ Then by integration by parts, \begin{eqnarray*} \int^1_0 \arctan(x)&=&\left.x\arctan(x)\right|^1_0-\int^1_0 \frac{x}{1+x^2}\, dx\\ &=&\left.x\arctan(x)\right|^1_0-\left.\frac{1}{2}\ln (1+x^2)\right|^1_0\\ &=&\left(\frac{\pi}{4}-0\right)-\left(\frac{1}{2} \ln (2)-0\right)\\ &=&\frac{\pi}{4}-\ln (\sqrt{2}). \end{eqnarray*} Sometimes it is necessary to integrate twice by parts in order to compute an integral:

###### Example

Let’s compute $\displaystyle\int\! e^x\cos x\, dx$.

Let $\begin{array}{ll} u = e^x\qquad\qquad & dv = \cos x\, dx\\ du = e^x\, dx & v = \sin x \end{array}$ Then $\displaystyle\int\! e^x\cos x\, dx=e^x\sin x-\int\! e^x\sin x\, dx$.

It is not clear yet that we’ve accomplished anything, but now let’s integrate the integral on the right-hand side by parts:

Now let $\begin{array}{ll} u = e^x\qquad\qquad & dv = \sin x\, dx\\ du = e^x\, dx & v = -\cos x \end{array}$ So $\displaystyle\int\! e^x\sin x\, dx=-e^x\cos x+\int e^x\cos x\, dx$.

Substituting this into $\displaystyle\int\! e^x\cos x\, dx=e^x\sin x-\int\! e^x\sin x\, dx$, \begin{eqnarray*} \int e^x\cos x\, dx&=&e^x\sin x-\left[-e^x\cos x+\int e^x\cos x\, dx\right]\\ &=&e^x\sin x+ e^x\cos x -\int e^x\cos x\, dx. \end{eqnarray*} The integal $\displaystyle\int\! e^x\cos x\, dx$ appears on both sides on the equation, so we can solve for it: $2\int e^x\cos x\, dx=e^x\sin x+e^x\cos x.$ Finally, $\int e^x\cos x\, dx =\frac{1}{2}e^x\sin x+\frac{1}{2}e^x\cos x +C.$

We may verify $\displaystyle\int\! e^x\cos x\, dx=\frac{1}{2}e^x\sin x+\frac{1}{2}e^x\cos x+C$ by differentiating the right-hand side: \begin{eqnarray*} \frac{d}{dx}\left(\frac{1}{2}e^x\sin x+\frac{1}{2}e^x\cos x+C\right)&=&\frac{1}{2}e^x\cos x+\frac{1}{2}e^x\sin x-\frac{1}{2}e^x\sin +\frac{1}{2}e^x\cos x\\ &=&e^x\cos x. \end{eqnarray*}

#### Key Concept

$\int u\, dv=uv-\int v\, du.$

• Choose $u$, $dv$ in such a way that:
1. $u$ is easy to differentiate.
2. $dv$ is easy to integrate.
3. $\displaystyle\int\! v\, du$ is easier to compute that $\displaystyle\int\! u\, dv$.
• Sometimes it is necessary to integrate by parts more than once.