# Primitive function/Integration by parts/Section

## Theorem

Let

${\displaystyle f,g\colon [a,b]\longrightarrow \mathbb {R} }$

denote continuously differentiable functions. Then

${\displaystyle {}\int _{a}^{b}f(t)g'(t)\,dt=fg|_{a}^{b}-\int _{a}^{b}f'(t)g(t)\,dt\,.}$

### Proof

Due to the product rule, the function ${\displaystyle {}fg}$ is a primitive function for ${\displaystyle {}fg'+f'g}$. Therefore,

${\displaystyle {}\int _{a}^{b}f(t)g'(t)\,dt+\int _{a}^{b}f'(t)g(t)\,dt=\int _{a}^{b}{\left(fg'+f'g\right)}(t)\,dt=fg|_{a}^{b}\,.}$
${\displaystyle \Box }$

In using integration by parts, two things are to be considered. Firstly, the function to be integrated is usually not in the form ${\displaystyle {}fg'}$, but just as a product ${\displaystyle {}uv}$ (if there is no product, then this rule will probably not help, however, sometimes the trivial product ${\displaystyle {}1u}$ might help). Then for one factor, we have to find a primitive function, and we have to differentiate the other factor. If ${\displaystyle {}V}$ is a primitive function of ${\displaystyle {}v}$, then the formula reads

${\displaystyle {}\int uv=uV-\int u'V\,.}$

Secondly, integration by parts only helps when the integral on the right, i.e. ${\displaystyle {}\int _{a}^{b}f'(t)g(t)\,dt}$, can be integrated.

## Example

We determine a primitive function for the natural logarithm ${\displaystyle {}\ln x}$, with integration by parts. We write ${\displaystyle {}\ln x=1\cdot \ln x}$, and we integrate the constant function ${\displaystyle {}1}$, and we differentiate the logarithm. Then

${\displaystyle {}\int _{a}^{b}\ln x\,dx=(x\cdot \ln x)|_{a}^{b}-\int _{a}^{b}x\cdot {\frac {1}{x}}\,dx=(x\cdot \ln x)|_{a}^{b}-\int _{a}^{b}1\,dx=(x\cdot \ln x)|_{a}^{b}-x|_{a}^{b}\,.}$

So a primitive function is ${\displaystyle {}x\cdot \ln x-x}$.

## Example

A primitive function for the sine function ${\displaystyle {}\sin x}$ is ${\displaystyle {}-\cos x}$. In order to find a primitive function for ${\displaystyle {}\sin ^{n}x}$, we use integration by parts to get a recursive relation to a power with a smaller exponent. To make this more precise, we work over an interval, the primitive function shall start at ${\displaystyle {}0}$ and have the value ${\displaystyle {}0}$ there. For ${\displaystyle {}n\geq 2}$, with integration by parts, we get

{\displaystyle {}{\begin{aligned}\int _{0}^{x}\sin ^{n}t\,dt&=\int _{0}^{x}\sin ^{n-2}t\cdot \sin ^{2}t\,dt\\&=\int _{0}^{x}\sin ^{n-2}t\cdot {\left(1-\cos ^{2}t\right)}\,dt\\&=\int _{0}^{x}\sin ^{n-2}t\,dt-\int _{0}^{x}{\left(\sin ^{n-2}t\cos t\right)}\cos t\,dt\\&=\int _{0}^{x}\sin ^{n-2}t\,dt-{\frac {\sin ^{n-1}t}{n-1}}\cos t|_{0}^{x}-{\frac {1}{n-1}}{\left(\int _{0}^{x}\sin ^{n}t\,dt\right)}.\end{aligned}}}

Multiplication with ${\displaystyle {}n-1}$ and rearranging yields

${\displaystyle {}n\int _{0}^{x}\sin ^{n}t\,dt=(n-1)\int _{0}^{x}\sin ^{n-2}t\,dt-\sin ^{n-1}x\cos x\,.}$

In particular, for ${\displaystyle {}n=2}$, we have

${\displaystyle {}\int _{0}^{x}\sin ^{2}t\,dt={\frac {1}{2}}{\left(x-\sin x\cos x\right)}\,.}$