8.1. Primitive Functions
It is a common exercise in differential calculus to compute the derivative of a differentiable function. In this chapter we will go for the reverse task, i.e. we will try to decide if a given function is the derivative of another one and will look for methods to find one of those.
As a start we introduce the basic notions.
Definition: Take $\varnothing \ne A\subset \mathbb{R}$ and let $f:A\to \mathbb{R}$ be any function. A differentiable function $g:A\to \mathbb{R}$ is called a primitive function of f if
f is called
integrable.
i 
primitiveintegrable would be more precise as there are further notions of integrability, e.g. Riemann integrability and Lesbesgue integrability to name but a few.
Although these different types of integrability are not equivalent many functions are integrable in several ways and their corresponding integrals (to be introduced in the next chapter) are the same.

(on A) if f has a primitive function. The symbol $\mathcal{I}(A)$ denotes the set of all integrable functions on A.

Consider:
In a known context g is often just called a primitive instead of a primitive function of f. Occasionally g is also called an antiderivative of f.
A function f is integrable if and only if it is the derivative of another (differentiable) function. f itself doesn't need to be differentiable.
The equation ${g}^{\prime}=f$ now has two different interpretations:
f is the derivative of g.
g is a primitive of f
Deriving g is (mostly) a simple test to decide if g is a primitive of f.
If $f\in \mathcal{I}(A)$ the set A is the domain of a differentiable function. Thus each $x\in A$ has to be an
accumulation point
i 
i.e. there is a sequence $({a}_{n})$ in A such that $x\ne {a}_{n}\to x$. Primarily this insures the uniqueness of the derivative numbers ${f}^{\prime}(x)$. [7.3.1] and [6.8.2] provide the details.

of A. Hence the set $\mathcal{I}(A)$ is empty if A contains points other than accumulation ones.
Example:

X is a primitive function of 1, as ${\mathrm{X}}^{\prime}=1$.

$\mathrm{X}}^{2$ is a primitive function of 2X, as $({\mathrm{X}}^{2}{)}^{\prime}=2\mathrm{X}$.

−cos is a primitive function of $\mathrm{sin}$, as $(\mathrm{cos}{)}^{\prime}=\mathrm{sin}$.

$\mathrm{sin}$ is a primitive function of $\mathrm{cos}$, as $\mathrm{sin}}^{\prime}=\mathrm{cos$.

$\mathrm{sin}+2$ is a primitive function of $\mathrm{cos}$, as $(\mathrm{sin}+2{)}^{\prime}=\mathrm{cos}$.

This sample list could be extended arbitrarily without any effort as long as we take a function that we know as a derivative from our memory. There are many other functions however, take for instance X·sin, that may cause severe problems.
The latter two examples prove that a function may well have more than one primitive. The expression "the primitive function of f" is thus incorrect, it has to be "a primitive function of f".
If A is an interval however the different primitive functions are quite wellassorted. Furthermore we will get a certain uniqueness if we prescribe a single value of g.
Proposition: With an interval I we have for each $f\in \mathcal{I}(I)$:

If $g}_{1$ and $g}_{2$ are two primitives of f there is a $c\in \mathbb{R}$ such that

If $a\in I$ there is a unique primitive g of f for each $b\in \mathbb{R}$ such that
Proof:
1. ► The function $g}_{1}{g}_{2$ is differentiable on I with $({g}_{1}{g}_{2}{)}^{\prime}={{g}_{1}}^{\prime}{{g}_{2}}^{\prime}=ff=0$. Due to an implication of the mean value theorem [7.9.7] the difference $g}_{1}{g}_{2$ is thus constant so that there is a $c\in \mathbb{R}$ such that ${g}_{1}{g}_{2}=c$. But that means ${g}_{1}={g}_{2}+c$.
2. ► As f is integrable there is at least one primitive g of f. But then $gg(a)+b$ is a primitive as requested.
Now let h be a further primitive of this kind. According to 1. both of them differ only in an additive constant, say $g=h+c$. Evaluating this equality at a yields
$b=g(a)=h(a)+c=b+c$
so that $c=0$ and thus $g=h$.

This is a quite satisfying answer to the uniqueness problem for primitive functions. The existance problem however, i.e. the question if each function f has primitive, is to deal with yet.
To begin with we show that there are functions with no primitives. So it is not trivial to ask if a function is integrable.
Proposition: The function $f:[0,1]\to \mathbb{R}$ given by
$f(x)\u2254\{\begin{array}{l}1\text{, if}x=0\hfill \\ 0\text{, if}x\ne 0\hfill \end{array}$

[8.1.4] 
is not integrable.
Proof: Suppose the contrary. Then there is a differentiable function $g:[0,1]\to \mathbb{R}$ such that
${g}^{\prime}=f$.
In particular g is differentiable on the interval $]0,1]$ with ${g}^{\prime}(x)=f(x)=0$. Thus g is a constant on that interval (see [7.9.7]), i.e. there is a c such that
$g(x)=c\text{for all}x\in ]0,1]$.
As g is differentiable it is continuous as well and the missing value $g(0)$ can be calculated as follows:
$g(0)=g(\mathrm{lim}\frac{1}{n})=\mathrm{lim}g(\frac{1}{n})=c$.
Hence $g(x)=c$ for all x which provides the contradiction $f={g}^{\prime}=0$.

Next we ensure the integrability of continuous functions, at least on intervals. Unfortunately however this is not an equivalent description of integrability as there are
examples
i 
as for instance the function g given by
$g(x)\u2254\{\begin{array}{l}{x}^{2}\cdot \mathrm{sin}\frac{1}{x}\text{, falls}x\ne 0\hfill \\ 0\text{, falls}x=0\hfill \end{array}$
Proof:

of integrable functions that are discontinuous.
Theorem: If I is an interval every continuous function on I has a primitive function. In other words:
${\mathcal{C}}^{0}(I)\subset \mathcal{I}(I)$

[8.1.5] 
Proof:

The way primitives were constructed in the proof of [8.1.5] is hardly transferable to actual examples. Thus we may know of many functions that have a primitive but we have no idea to get one. Looking for constructive methods is certainly rewarding! The so called partial fraction decomposition provides such a method for rational functions.
We now need calculation rules for primitive functions. Once these rules are at our hand we will benefit from them in a similar way as we did from the derivation rules for differentiable functions. Firstly we transfer the sum rule, the difference rule and the factor rule.
Proposition: Let $c\in \mathbb{R}$ be arbitrary. If $g}_{1},{g}_{2$ are primitive functions of ${f}_{1},{f}_{2}\in \mathcal{I}(A)$ the following holds:
${f}_{1}+{f}_{2}\in \mathcal{I}(A)$ and $g}_{1}+{g}_{2$ is a primitive function of $f}_{1}+{f}_{2$.

[8.1.6] 
${f}_{1}{f}_{2}\in \mathcal{I}(A)$ and $g}_{1}{g}_{2$ is a primitive function of $f}_{1}{f}_{2$.

[8.1.7] 
$c\cdot {f}_{2}\in \mathcal{I}(A)$ and $c\cdot {g}_{2}$ is a primitive function of $c\cdot {f}_{2}$.

[8.1.8] 
Proof:
1. ► As $g}_{1$ and $g}_{2$ are differentiable their sum $g}_{1}+{g}_{2$ is differentiable as well due to the sum rule ([7.7.4]) with $({g}_{1}+{g}_{2}{)}^{\prime}={{g}_{1}}^{\prime}+{{g}_{2}}^{\prime}={f}_{1}+{f}_{2}$. This proves $g}_{1}+{g}_{2$ to be a primitive function of $f}_{1}+{f}_{2$.
2. and 3. ► are similarly traced back to the appropriate derivation rules.

The new calculation rules will come to life of course only if we have primitives of some of the basic functions. Besides sine and cosine from the first examples we will put the power functions onto that list.
Proposition: For each $n\in \mathbb{Z},\text{\hspace{0.17em}}n\ne 1$
$\frac{1}{n+1}{\mathrm{X}}^{n+1}$ is a primitive function of $\mathrm{X}}^{n$.

[8.1.9] 
Proof: The function $\frac{1}{n+1}{\mathrm{X}}^{n+1}$ is differentiable with $(\frac{1}{n+1}{\mathrm{X}}^{n+1}{)}^{\prime}=\frac{n+1}{n+1}{\mathrm{X}}^{n}={\mathrm{X}}^{n}$.

Consider:

Combined with the calculation rules [8.1.9] guarantees the integrability of polynomials and allows integration to be carried out addendwise: If $p=\sum _{i=0}^{n}{a}_{i}{\mathrm{X}}^{i}$ is a polynomial
$\sum _{i=0}^{n}\frac{{a}_{i}}{i+1}{\mathrm{X}}^{i+1}$

[8.1.10] 
is a primitive function of p.

In particular $c\mathrm{X}$ is a primitive of c.

The reciprocal function $\mathrm{X}}^{1$ is not in the scope of [8.1.9]!
Example:

$\mathrm{X}}^{12$ has $\frac{1}{13}{\mathrm{X}}^{13}$ as a primitive.

$\mathrm{X}}^{4$ has $\frac{1}{3}{\mathrm{X}}^{3}$ as a primitive.

$3{\mathrm{X}}^{7}+4\mathrm{X}1$ has $\frac{3}{8}{\mathrm{X}}^{8}+2{\mathrm{X}}^{2}\mathrm{X}$ as a primitive.

$2\mathrm{cos}5$ has $2\mathrm{sin}5\mathrm{X}$ as a primitive.

Transferring further derivation rules is bit more complex. Whereas the product and chain rule will be dealt with separately the following two special cases of the chain and quotient rule are easily transferred. They are quite effective.
Proposition: For any differentiable $f:A\to \mathbb{R}$ we have:
$f\cdot {f}^{\prime}\in \mathcal{I}(A)$ and $\frac{1}{2}{f}^{2}$ is a primitive function of $f\cdot {f}^{\prime}$.

[8.1.11] 
$\frac{{f}^{\prime}}{{f}^{2}}\in \mathcal{I}(\{x\in Af(x)\ne 0\})$ and $\frac{1}{f}$ is a primitive function of $\frac{{f}^{\prime}}{{f}^{2}}$.

[8.1.12] 
Proof:
1. ► Due to a special case of the chain rule [7.7.12] $\frac{1}{2}{f}^{2}$ is differentiable with
$(\frac{1}{2}{f}^{2}{)}^{\prime}=\frac{2}{2}f\cdot {f}^{\prime}=f\cdot {f}^{\prime}$.
2. ► We employ the reciprocal rule [7.7.11] to see that $\frac{1}{f}$ differentiable with $(\frac{1}{f}{)}^{\prime}=\frac{{f}^{\prime}}{{f}^{2}}$.

Using these rules however requires a certain sense of proportion. For the first rule for instance we need to see that a given function is in fact the product of a function with its own derivative.
Example:
$\mathrm{sin}\cdot \mathrm{cos}$ has $\frac{1}{2}{\mathrm{sin}}^{2}$ as a primitive as $\mathrm{sin}\cdot \mathrm{cos}=\mathrm{sin}\cdot {\mathrm{sin}}^{\prime}$.
$\frac{\mathrm{tan}}{\mathrm{cos}}$ has $\frac{1}{\mathrm{cos}}$ as a primitive as $\frac{\mathrm{tan}}{\mathrm{cos}}=\frac{\mathrm{sin}}{{\mathrm{cos}}^{2}}=\frac{(\mathrm{cos}{)}^{\prime}}{{(\mathrm{cos})}^{2}}$.
Exercise:
$\phantom{}{\text{?}}\frac{1}{2}{\mathrm{exp}}^{2}$ is a primitive of $\mathrm{exp}}^{2}=\mathrm{exp}\cdot \mathrm{exp}=\mathrm{exp}\cdot {\mathrm{exp}}^{\prime$.
$\text{?}}\frac{1}{2}\frac{1}{{\mathrm{X}}^{2}+1$ is a primitive of $\phantom{}\frac{\mathrm{X}}{{\mathrm{X}}^{4}+2{\mathrm{X}}^{2}+1}={\text{?}}\frac{1}{2}\frac{2\mathrm{X}}{({\mathrm{X}}^{2}+1{)}^{2}}$.
For an arbitrary differentiable function $f:A\to \mathbb{R}$ $\phantom{}{\text{?}}\frac{1}{n}{f}^{n}$ is a primitive of $f}^{n1}\cdot {f}^{\prime$.

Mathematica's Integrator is a very useful online calculator that finds primitives of many common (and not so common) integrable functions with a mouse click! To understand the Integrator's notation however it is essential to have studied the fundamental theorem of calculus [8.2.12] in the next chapter.
Parallel to the
concatenation
i 
For $f:A\to \mathbb{R}$ and $g:B\to \mathbb{R}$ with $f(x)=g(x)$ for all $x\in A\cap B$ we set
$f\cup g(x)=\{\begin{array}{l}f(x)\text{, if}x\in A\hfill \\ g(x)\text{, if}x\in B\hfill \end{array}$

of continuous and differentiable functions we now study the concatenation of integrable functions. As a preparation to that we check the restriction truth of integration first.
Proposition: Let A be a set such that $\varnothing \ne A\subset B$ and that each $x\in A$ is an accumulation point of A. If $f:B\to \mathbb{R}$ is integrable on B with $g:B\to \mathbb{R}$ as a primitive of f then
and $gA$ is a primitive of $fA$. The reverse of [1.8.13] does not hold.
Proof: As a primitive of f the function g is differentiable with ${g}^{\prime}=f$. According to [7.4.1] $gA$ is hence differentiable at every $x\in A$ with
$(gA{)}^{\prime}(x)={g}^{\prime}(x)=f(x)=fA(x)$.
But that proves $gA$ to be a primitive function of $fA$.
The nonintegrable function f from example [8.1.4] has an integrable restriction $f]0,1]=0$.

On intervals concatenation now turns out to correspond surprisingly straightforward with integrability.
Proposition: Let $I}_{1$ and $I}_{2$ be two intervals with a nonempty intersection, i.e. ${I}_{1}\cap {I}_{2}\ne \varnothing$. For any two functions $f}_{1}:{I}_{1}\to \mathbb{R$ and $f}_{2}:{I}_{2}\to \mathbb{R$ such that $f}_{1}{I}_{1}\cap {I}_{2}={f}_{2}{I}_{1}\cap {I}_{2$ we have:
$f}_{1}\cup {f}_{2$ is integrable$\text{\hspace{1em}}\iff \text{\hspace{1em}}{f}_{1}$ and $f}_{2$ are integrable.

[8.1.14] 
Proof:
"$\Rightarrow$": If g is a primitive of $f}_{1}\cup {f}_{2$ then $g{I}_{i}$ is a primitive of $f}_{i$ due to [8.1.13].
"$\Leftarrow$": We first note that there are only two options for the nonempty intersection $I$:
The intersection is a singleton: $I=\left\{a\right\}$
The insection is again an interval
Now let $g}_{1$ be a primitive of $f}_{1$. In both cases we will show that there is a primitive $g}_{2$ of $f}_{2$ such that
${g}_{1}I={g}_{2}I$. [1]
The first case is easily done as [8.1.3] allows us to find a primitive $g}_{2$ of $f}_{2$ such that ${g}_{2}(a)={g}_{1}(a)$.
For the second case we first take an arbitrary primitive g of $f}_{2$. According to [8.1.13] ${g}_{1}I$ and $gI$ are two primitives of ${f}_{2}I$. Due to [8.1.2] we hence find a number c such that
${g}_{1}I=gI+c$.
${g}_{2}\u2254g+c$ is thus a primitive of $f}_{2$ satisfying [1].
As $g}_{1$ and $g}_{2$ are continuous the identity [1] is extendable to all accumulation points of I that are members of $I}_{1}\cup {I}_{2$. We thus may assume that I already contains all accumulation points of this kind.
Now we show that $g}_{1}\cup {g}_{2$ is a primitive function of $f}_{1}\cup {f}_{2$. If $x\in I$ the concatenation $g}_{1}\cup {g}_{2$ is differentiable at x according to [7.4.5] with
$({g}_{1}\cup {g}_{2}{)}^{\prime}(x)={{g}_{1}}^{\prime}(x)={{g}_{2}}^{\prime}(x)={f}_{1}(x)={f}_{2}(x)={f}_{1}\cup {f}_{2}(x)$.
If $x\notin I$, say $x\in {I}_{1}$, x is no accumulation point of I due to our preliminary note. Hence there is a relative εneighbourhood $I}_{{1}_{x,\epsilon}$ such that ${I}_{{1}_{x,\epsilon}}\cap I=\varnothing$ which implies $({g}_{1}\cup {g}_{2}){I}_{{1}_{x,\epsilon}}={g}_{1}{I}_{{1}_{x,\epsilon}}$. As differentiability is a local property (see [7.4.2]) we thus know: $g}_{1}\cup {g}_{2$ is differentiable at x with
$({g}_{1}\cup {g}_{2}{)}^{\prime}(x)={{g}_{1}}^{\prime}(x)={f}_{1}(x)={f}_{1}\cup {f}_{2}(x)$.

As an example we consider the absolute value function which is representable as the concatenation of two continuous functions, namely
$\mathrm{X}{\mathbb{R}}^{\le 0}$ and $\mathrm{X}{\mathbb{R}}^{\ge 0}$. As their primitives $\frac{1}{2}{\mathrm{X}}^{2}{\mathbb{R}}^{\le 0}$ and $\frac{1}{2}{\mathrm{X}}^{2}{\mathbb{R}}^{\ge 0}$ already coincide on the singleton $\{0\}={\mathbb{R}}^{\le 0}\cap {\mathbb{R}}^{\ge 0}$ we get
$\frac{1}{2}{\mathrm{X}}^{2}{\mathbb{R}}^{\le 0}\cup \frac{1}{2}{\mathrm{X}}^{2}{\mathbb{R}}^{\ge 0}=\frac{1}{2}\mathrm{X}\cdot \mathrm{X}$
as a primtive function of $\mathrm{X}$.
In a second example we study for any $n\in {\mathbb{N}}^{>1}$ the function
${f}_{n}=(n\mathrm{X}+1)[\mathrm{0,}\frac{1}{n}]\cup 0[\frac{1}{n}\mathrm{,1}]$[2]


$(n\mathrm{X}+1)[\mathrm{0,}\frac{1}{n}]$ and $0[\frac{1}{n}\mathrm{,1}]$ are continuous functions on intervals and are thus integrable. They coincide at their overlap point $\frac{1}{n}$, so that each $f}_{n$ has a primitive function.
Interestingly the sequence of functions $({f}_{n})$ converges pointwise to the nonintegrable function f from [8.1.4], because $({f}_{n}(0){)}_{n>1}={(1)}_{n>1}$ if $x=0$, and $({f}_{n}(x){)}_{n\ge {\scriptstyle \frac{1}{x}}}={(0)}_{n\ge {\scriptstyle \frac{1}{x}}}$ for each $x\in ]0,1]$. Example [2] thus proves that pointwise convergence and integrability are incompatible. Uniform convergence however behaves better.
Proposition: Let $({f}_{n})$ be a sequence of integrable functions on an interval I, i.e. ${f}_{n}\in \mathcal{I}(I)$ for all n, and $f:I\to \mathbb{R}$ an arbitrary function. Then:
${f}_{n}\underset{uf}{\to}f\text{\hspace{1em}}\Rightarrow \text{\hspace{1em}}f\in \mathcal{I}(I)$

[8.1.15] 
Proof: Due to the premise there is a primitive $g}_{n}:I\to \mathbb{R$ of $f}_{n$ for each n. $g}_{n$ is differentiable with ${g}_{n}}^{\prime}={f}_{n$. According to [8.1.3] we may assume that ${g}_{n}(a)=0$ for a fixed $a\in I$. The uniform convergence ${{g}_{n}}^{\prime}={f}_{n}\underset{uf}{\to}f$ is obviously passed on to every closed subinterval $J\subset I$:
${{g}_{n}}^{\prime}J\underset{uf}{\to}fJ$
Due to [7.12.3] the pointwise limit $g\u2254\mathrm{lim}\phantom{\rule{0.2em}{0ex}}{g}_{n}$ thus exists and is a primitive of f.

Consider:
