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?
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 31, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://www.mathemafrica.org/?p=10788", "fetch_time": 1642383560000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-05/segments/1642320300253.51/warc/CC-MAIN-20220117000754-20220117030754-00643.warc.gz", "warc_record_offset": 104062496, "warc_record_length": 37198, "token_count": 784, "char_count": 2433, "score": 4.65625, "int_score": 5, "crawl": "CC-MAIN-2022-05", "snapshot_type": "longest", "language": "en", "language_score": 0.8426069617271423, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00045-of-00064.parquet"}