Here we are going to come up with our second method for solving integrals which we can’t solve by inspection (noting that they are the antiderivative of some function which we know well).

We know the product rule for differentiation: $\frac{d (f(x)g(x))}{dx}=f'(x)g(x)+f(x)g'(x)$

Integrating it gives us: $f(x)g(x)+c=\int f'(x)g(x)dx+\int f(x)g'(x)dx$

We can then rearrange this to give: $\int f(x)g'(x)dx=f(x)g(x)-\int f'(x)g(x)dx$

We have dropped the $c$ because this will come also from doing the second integral.

This is also sometimes written in an alternative form:

Let $f(x)=u$ and $g(x)=v$. Sometimes we will keep the functional dependence explicit, and sometimes we won’t – it is up to you to follow what things are functions of $x$ and what are constants. You will get more and more familiar with it over time.

Now we can write: $f'(x)=\frac{du}{dx}\,\,\,\,\,\,\,\,g'(x)=\frac{dv}{dx}$

Now put this into the equation above for integration by parts. $\int u \frac{dv}{dx} dx=uv-\int v \frac{du}{dx} dx$

cancelling the factors of $dx$: $\int u dv=uv-\int v du$

(Actually the idea of cancelling the factors of $dx$ is rather sloppy, but here it goes through ok).

Whenever we are doing an integration by parts our job is to figure out which function we are going to choose to be $u$ and which part is going to be $dv$.

### Some examples $\int x e^{6x} dx$

we will generally choose $f(x)$ (ie. $u$) to be the function which when differentiated becomes simpler. In this case we choose $f(x)=x$ and $g'(x)=e^{6x}$. Then $f'(x)=1$ and $g(x)=\frac{e^{6x}}{6}$.

Plug this into the formula: $\int x e^{6x} dx= x \frac{e^{6x}}{6}-\int \frac{e^{6x}}{6} dx= x \frac{e^{6x}}{6}-\frac{e^{6x}}{36}+c$

Let’s try a simple example: $\int x\ln x dx$

If we take $f(x)=\ln x$ and $g'(x)=x$, then $f'(x)=\frac{1}{x}$ and $g(x)=\frac{x^2}{2}$. Then the equation becomes: $\int x\ln x dx= \frac{x^2}{2}\ln x-\int \frac{x^2}{2}\frac{1}{x}dx= \frac{x^2}{2}\ln x-\int \frac{x}{2}dx= \frac{x^2}{2}\ln x-\frac{x^2}{4}+c$

A general rule, but not to be taken as sacred:  Very often you can use integration by parts if you have a product of terms, one of which will simplify when you integrate it, and one of which will simplify when you differentiate it. The one that simplifies when you differentiate it should be $u$, and the one that simplifies when you integrate (multiplied by $dx$) should be $dv$.

 How clear is this post?