### Integration by parts

Strangely, the subtlest standard method is just the *product rule*
run backwards. This is called **integration by parts**. (This might
seem strange because often people find the chain rule for
differentiation harder to get a grip on than the product rule). One
way of writing the integration by parts rule is $$\int f(x)\cdot
g'(x)\;dx=f(x)g(x)-\int f'(x)\cdot g(x)\;dx$$ Sometimes this is
written another way: if we use the notation that for a function $u$ of
$x$,
$$du={du\over dx}\;dx$$
then for two functions $u,v$ of $x$ the rule is
$$\int u\;dv=uv-\int v\;du.$$

Yes, it is hard to see how this might be helpful, but it is. The first theme we'll see in examples is where we could do the integral except that there is a power of $x$ ‘in the way’:

The simplest example is $$\int x\;e^x\;dx=\int x\;d(e^x)=x\,e^x-\int e^x\;dx=x\,e^x-e^x+C$$ Here we have taken $u=x$ and $v=e^x$. It is important to be able to see the $e^x$ as being the derivative of itself.

A similar example is $$\int x\;\cos x\;dx=\int x\;d(\sin x)= x\,\sin x-\int \sin x\;dx=x\,\sin x+\cos x +C$$ Here we have taken $u=x$ and $v=\sin x$. It is important to be able to see the $\cos x$ as being the derivative of $\sin x$.

Yet another example, illustrating also the idea of *repeating*
the integration by parts:
\begin{align*}
\int x^2\;e^x\;dx&=\int x^2\;d(e^x)=x^2\,e^x-\int e^x\;d(x^2)\\
&=x^2\,e^x-2 \int x\,e^x\;dx=x^2\,e^x-2x\,e^x+2\int e^x\;dx\\
&=x^2\,e^x-2x\,e^x+2e^x+C
\end{align*}
Here we integrate by parts twice. After the first integration by
parts, the integral we come up with is $\int xe^x\,dx$, which we had
dealt with in the first example.

Or sometimes the theme is that it is easier to integrate the
*derivative* of something than to integrate the thing:
\begin{align*}
\int \ln x\;dx&=\int \ln x\;d(x)=x\ln x-\int x\; d(\ln x)\\
&=x\ln x-\int x\;{1\over x}\; dx=x\ln x-\int 1\; dx=x\ln x-x+C
\end{align*}
We took $u=\ln x$ and $v=x$.

Again in this example it is easier to integrate the derivative than the thing itself: \begin{align*} \int \arctan x\;dx&=\int \arctan x\;d(x)=x\arctan x-\int x\; d(\arctan x)\\ &=x\arctan x-\int {x\over 1+x^2}\;dx =x\arctan x-{1\over 2}\int {2x\over 1+x^2}\;dx\\ &=x\arctan x-{1\over 2}\ln(1+x^2)+C \end{align*} since we should recognize the $${2x\over 1+x^2}$$ as being the derivative (via the chain rule) of $\ln(1+x^2)$.

#### Exercises

- $\int \ln\,x\,dx=?$
- $\int xe^x\,dx=?$
- $\int (\ln\,x)^2\,dx=?$
- $\int xe^{2x}\,dx=?$
- $\int \arctan\,3x\,dx=?$
- $\int x^3\ln x\,dx=?$
- $\int \ln\,3x\,dx=?$
- $\int x\ln x\,dx=?$

#### Thread navigation

##### Calculus Refresher

- Previous: Volume of surfaces of revolution
- Next: Partial fractions