# 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 ℝ$ and let $f:A\to ℝ$ be any function. A differentiable function $g:A\to ℝ$ is called a primitive function of f if

 ${g}^{\prime }=f$ [8.1.1]

f is called integrable.
 i primitive-integrable 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}\left(A\right)$ 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:

1. f is the derivative of g.

2. 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}\left(A\right)$ 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 $\left({a}_{n}\right)$ in A such that $x\ne {a}_{n}\to x$. Primarily this insures the uniqueness of the derivative numbers ${f}^{\prime }\left(x\right)$. [7.3.1] and [6.8.2] provide the details.
of A. Hence the set $\mathcal{I}\left(A\right)$ 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 $\left({\mathrm{X}}^{2}{\right)}^{\prime }=2\mathrm{X}$. −cos is a primitive function of $\mathrm{sin}$, as $\left(-\mathrm{cos}{\right)}^{\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 $\left(\mathrm{sin}+2{\right)}^{\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 well-assorted. 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}\left(I\right)$:

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

 ${g}_{1}={g}_{2}+c$. [8.1.2]
1. If $a\in I$ there is a unique primitive g of f for each $b\in ℝ$ such that

 $g\left(a\right)=b$. [8.1.3]

Proof:

1.   The function ${g}_{1}-{g}_{2}$ is differentiable on I with $\left({g}_{1}-{g}_{2}{\right)}^{\prime }={{g}_{1}}^{\prime }-{{g}_{2}}^{\prime }=f-f=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 ℝ$ 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 $g-g\left(a\right)+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\left(a\right)=h\left(a\right)+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:\left[0,1\right]\to ℝ$ given by

 [8.1.4]

is not integrable.

Proof:  Suppose the contrary. Then there is a differentiable function $g:\left[0,1\right]\to ℝ$ such that

${g}^{\prime }=f$.

In particular g is differentiable on the interval $\right]0,1\right]$ with ${g}^{\prime }\left(x\right)=f\left(x\right)=0$. Thus g is a constant on that interval (see [7.9.7]), i.e. there is a c such that

.

As g is differentiable it is continuous as well and the missing value $g\left(0\right)$ can be calculated as follows:

$g\left(0\right)=g\left(\mathrm{lim}\frac{1}{n}\right)=\mathrm{lim}g\left(\frac{1}{n}\right)=c$.

Hence $g\left(x\right)=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
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}\left(I\right)\subset \mathcal{I}\left(I\right)$ [8.1.5]

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 ℝ$ be arbitrary. If ${g}_{1},{g}_{2}$ are primitive functions of ${f}_{1},{f}_{2}\in \mathcal{I}\left(A\right)$ the following holds:

 ${f}_{1}+{f}_{2}\in \mathcal{I}\left(A\right)$ and ${g}_{1}+{g}_{2}$ is a primitive function of ${f}_{1}+{f}_{2}$. [8.1.6]
 ${f}_{1}-{f}_{2}\in \mathcal{I}\left(A\right)$ and ${g}_{1}-{g}_{2}$ is a primitive function of ${f}_{1}-{f}_{2}$. [8.1.7]
 $c\cdot {f}_{2}\in \mathcal{I}\left(A\right)$ 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 $\left({g}_{1}+{g}_{2}{\right)}^{\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 ℤ,\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 $\left(\frac{1}{n+1}{\mathrm{X}}^{n+1}{\right)}^{\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 ℝ$ we have:

 $f\cdot {f}^{\prime }\in \mathcal{I}\left(A\right)$ 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}\left(\left\{x\in A|f\left(x\right)\ne 0\right\}\right)$ 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

$\left(\frac{1}{2}{f}^{2}{\right)}^{\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 $\left(-\frac{1}{f}{\right)}^{\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{\left(-\mathrm{cos}{\right)}^{\prime }}{{\left(-\mathrm{cos}\right)}^{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}}{\left({\mathrm{X}}^{2}+1{\right)}^{2}}$. For an arbitrary differentiable function $f:A\to ℝ$   $\phantom{|}{\text{?}}\frac{1}{n}{f}^{n}$ is a primitive of ${f}^{n-1}\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 ℝ$ and $g:B\to ℝ$ with  $f\left(x\right)=g\left(x\right)$ for all $x\in A\cap B$ we set
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 ℝ$ is integrable on B with $g:B\to ℝ$ as a primitive of f then

 $f|A$ is integrable on A [8.1.13]

and $g|A$ is a primitive of $f|A$. 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]  $g|A$ is hence differentiable at every $x\in A$ with

$\left(g|A{\right)}^{\prime }\left(x\right)={g}^{\prime }\left(x\right)=f\left(x\right)=f|A\left(x\right)$.

But that proves $g|A$ to be a primitive function of $f|A$.

The non-integrable function f from example [8.1.4] has an integrable restriction $f|\right]0,1\right]=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 non-empty intersection, i.e. ${I}_{1}\cap {I}_{2}\ne \varnothing$. For any two functions ${f}_{1}:{I}_{1}\to ℝ$ and ${f}_{2}:{I}_{2}\to ℝ$ 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{ }⇔\text{ }{f}_{1}$ and ${f}_{2}$ are integrable. [8.1.14]

Proof:

"$⇒$":  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].

"$⇐$":  We first note that there are only two options for the non-empty intersection $I$:

1. The intersection is a singleton: $I=\left\{a\right\}$

2. 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}\left(a\right)={g}_{1}\left(a\right)$.

For the second case we first take an arbitrary primitive g of ${f}_{2}$. According to [8.1.13]  ${g}_{1}|I$ and $g|I$ are two primitives of ${f}_{2}|I$. Due to [8.1.2] we hence find a number c such that

${g}_{1}|I=g|I+c$.

${g}_{2}≔g+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

$\left({g}_{1}\cup {g}_{2}{\right)}^{\prime }\left(x\right)={{g}_{1}}^{\prime }\left(x\right)={{g}_{2}}^{\prime }\left(x\right)={f}_{1}\left(x\right)={f}_{2}\left(x\right)={f}_{1}\cup {f}_{2}\left(x\right)$.

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 $\left({g}_{1}\cup {g}_{2}\right)|{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

$\left({g}_{1}\cup {g}_{2}{\right)}^{\prime }\left(x\right)={{g}_{1}}^{\prime }\left(x\right)={f}_{1}\left(x\right)={f}_{1}\cup {f}_{2}\left(x\right)$.

As an example we consider the absolute value function which is representable as the concatenation of two continuous functions, namely $-\mathrm{X}|{ℝ}^{\le 0}$ and $\mathrm{X}|{ℝ}^{\ge 0}$. As their primitives $-\frac{1}{2}{\mathrm{X}}^{2}|{ℝ}^{\le 0}$ and $\frac{1}{2}{\mathrm{X}}^{2}|{ℝ}^{\ge 0}$ already coincide on the singleton $\left\{0\right\}={ℝ}^{\le 0}\cap {ℝ}^{\ge 0}$ we get

$-\frac{1}{2}{\mathrm{X}}^{2}|{ℝ}^{\le 0}\cup \frac{1}{2}{\mathrm{X}}^{2}|{ℝ}^{\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 {ℕ}^{>1}$ the function

 ${f}_{n}=\left(-n\mathrm{X}+1\right)|\left[0,\frac{1}{n}\right]\cup 0|\left[\frac{1}{n},1\right]$[2] Your browser does not support inlineframes or the current configuration is not suitable.

$\left(-n\mathrm{X}+1\right)|\left[0,\frac{1}{n}\right]$ and $0|\left[\frac{1}{n},1\right]$ 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 $\left({f}_{n}\right)$ converges pointwise to the non-integrable function f from [8.1.4], because $\left({f}_{n}\left(0\right){\right)}_{n>1}={\left(1\right)}_{n>1}$ if $x=0$, and $\left({f}_{n}\left(x\right){\right)}_{n\ge \frac{1}{x}}={\left(0\right)}_{n\ge \frac{1}{x}}$ for each $x\in \right]0,1\right]$. Example [2] thus proves that pointwise convergence and integrability are incompatible. Uniform convergence however behaves better.

Proposition:  Let $\left({f}_{n}\right)$ be a sequence of integrable functions on an interval I, i.e. ${f}_{n}\in \mathcal{I}\left(I\right)$ for all n, and $f:I\to ℝ$ an arbitrary function. Then:

 ${f}_{n}\underset{uf}{\to }f\text{ }⇒\text{ }f\in \mathcal{I}\left(I\right)$ [8.1.15]

Proof:  Due to the premise there is a primitive ${g}_{n}:I\to ℝ$ 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}\left(a\right)=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 }f|J$

Due to [7.12.3] the pointwise limit $g≔\mathrm{lim}\phantom{\rule{0.2em}{0ex}}{g}_{n}$ thus exists and is a primitive of f.

Consider:

• From the proof of [8.1.15] we see that the condition ${f}_{n}\underset{uf}{\to }f$ may be alleviated by

${f}_{n}|J\underset{uf}{\to }f|J$  for all closed subintervals $J\subset I$.