# Math for Non-Geeks/ Constant functions

"A function is constant, if its derivative vanishes", i.e. $f'(x)=0$. This is the main statement which we want to make concrete in this article.

## Criterion for constant functions

Theorem
Let $I\subseteq \mathbb {R}$ be an interval and $f:I\to \mathbb {R}$ a differentiable function with $f'(x)=0$ for all $x\in I$. Then $f$ is constant.
Proof
Let $a,b\in I$ with $a<b$ be given. Let further $f$ be differentiable on $[a,b]$ such that for all $\xi \in I$ we have $f'(\xi )=0$. By the mean value theorem there is a $\xi \in (a,b)$ with
$f'(\xi )={\frac {f(b)-f(a)}{b-a}}$
We know that $f'(\xi )=0$ must hold. So:
$0=f'(\xi )={\frac {f(b)-f(a)}{b-a}}$
Since $a<b$ there is $b-a\neq 0$. Now we multiply both sides with $(b-a)$ :
$f(b)-f(a)=0\cdot (b-a)=0$
Or in other words, $f(a)=f(b)$. Since this holds for all $a$ and $b$ in $I$ , the function $f$ must be constant.

## Identity theorem of differential calculus

The first conclusion of $f'=0$ implying that a function is constant is that functions with identical derivatives are identical except for one constant. This result will prove very useful later on in the fundamental theorem of calculus.
Theorem (Identity theorem)
Let $f,g:[a,b]\to \mathbb {R}$ be two differentiable functions with $f'=g'$. Then, there is $f(x)=g(x)+c$ for all $x\in [a,b]$. Where $c\in \mathbb {R}$ is a constant number.
Proof (Identity theorem)
We define the auxiliary function
$h:[a,b]\to \mathbb {R} ,\ h(x)=f(x)-g(x)$
This function is differentiables ince $f$ and $g$ are differentiable and
$h'(x)=f'(x)-g'(x){\overset {f'=g'}{=}}0$
Hence, there must be $h(x)=f(x)-g(x)=c$ for all $x\in [a,b]$ with a constant number $c\in \mathbb {R}$. Or equivalently,
$f(x)=g(x)+c$

## Application: characterization of the exponential function

Theorem (Characterization of the exponential function)
Let $f:\mathbb {R} \to \mathbb {R}$ be differentiable. Further let $\lambda \in \mathbb {R}$ and for all $x\in \mathbb {R}$ we have
$f'(x)=\lambda f(x)$
Then, there is $f(x)=c\exp(\lambda x)$ for all $x\in \mathbb {R}$ with a constanten $c\in \mathbb {R}$. If $\lambda =1$ and in addition $f(0)=1$, then precisely $f=\exp$.
Proof (Characterization of the exponential function)
We define the auxiliary function
$h:\mathbb {R} \to \mathbb {R} ,\ h(x)=f(x)\exp(-\lambda x)$
By the product and the chain rule, it is differentiable. There is
${\begin{aligned}h'(x)&=f'(x)\exp(-\lambda x)+f(x)\exp(-\lambda x)(-\lambda )\\&=\lambda f(x)\exp(-\lambda x)-\lambda f(x)\exp(-\lambda x)=0\end{aligned}}$
According to the criterion for a function being constant there is a $c\in \mathbb {R}$ with $h(x)=f(x)\exp(-\lambda x)=c$ for all $x\in [a,b]$. But this is now equivalent to
$f(x)=c\exp(\lambda x)$
If now $\lambda =1$ and additionally $f(0)=1$, then
$f(0)=c\exp(0)=c=1$
So $f=\exp$.
Hint
Alternatively we can write $h$ as $h(x)={\tfrac {f(x)}{\exp(\lambda x)}}$ and apply the quotient rule to determine the derivative $h'$. Furthermore, the function $f(x)=c\exp(\lambda x)$ satisfies the differential equation $f'=\lambda f$, since there is:
$f'(x)=c\exp '(\lambda x)=c\lambda \exp(\lambda x)=\lambda c\exp(\lambda x)=\lambda f(x)$

## Exercises
### Interval assumption for constant functions

The condition that the function $f$ is defined on an interval is necessary for the criterion for constancy! This is illustrated by the following task:
Math for Non-Geeks: Template:Aufgabe

### Trigonometric Pythagorean theorem

Using the criterion for constancy, identities of functions can also be proven very well:
Math for Non-Geeks: Template:Aufgabe

### Function equation for arctan

Math for Non-Geeks: Template:Aufgabe

### Exercise: identity theorem

Math for Non-Geeks: Template:Aufgabe

### Characterization of sin and cos

Exercise (Characterization of sin and cos)
Let $s,c:\mathbb {R} \to \mathbb {R}$ be two differentiable functions with
${\begin{aligned}s'&=c,&s(0)&=0\\c'&=-s,&c(0)&=1\end{aligned}}$
Prove that:
* There is $s^{2}(x)+c^{2}(x)=1$ for all $x\in \mathbb {R}$
* There is exactly one pair of functions which meets the above conditions, namely $s=\sin$ and $c=\cos$.
Hint: Consider the help function in the second sub-task ${\hat {h}}(x)=(\sin(x)-s(x))^{2}+(\cos(x)-c(x))^{2}$.
Solution (Characterization of sin and cos)
Solution sub-exercise 1:
We consider the auxiliary function
${\tilde {h}}:\mathbb {R} \to \mathbb {R} ,\ {\tilde {h}}(x)=s^{2}(x)+c^{2}(x)$
where $s$ and $c$ fulfil the conditions from above. Then ${\tilde {h}}$ is differentiable by the sum and chain rule, and
${\begin{aligned}{\tilde {h}}'(x)&=2s(x)s'(x)+2c(x)c'(x)\\&=2s(x)c(x)+2c(x)(-s(x))\\&=2s(x)c(x)-2s(x)c(x)=0\end{aligned}}$
According to the criterion for constancy, there is ${\tilde {h}}(x)={\tilde {c}}$ for some $c\in \mathbb {R}$. We have
${\tilde {h}}(0)=s^{2}(0)+c^{2}(0)=0^{2}+1^{2}=1$
So ${\tilde {c}}=1$ and we get the claim ${\tilde {h}}(x)=s^{2}(x)+c^{2}(x)=1$.
Solution sub-exercise 2:
We consider the differential auxiliary function
${\hat {h}}:\mathbb {R} \to \mathbb {R} ,{\hat {h}}(x)=(\sin(x)-s(x))^{2}+(\cos(x)-c(x))^{2}$
For this function
${\begin{aligned}{\hat {h}}'(x)&=2(\sin(x)-s(x))(\cos(x)-s'(x))+2(\cos(x)-c(x))(-\sin(x)+c'(x))\\&{\overset {\text{assumption}}{=}}2(\sin(x)-s(x))(\cos(x)-c(x))+2(\cos(x)-c(x))(-\sin(x)-s(x))\\&=2(\sin(x)-s(x))(\cos(x)-c(x))-2(\cos(x)-c(x))(\sin(x)+s(x))\\&=0\end{aligned}}$
According to the criterion for constancy,there is ${\hat {h}}(x)={\hat {c}}$ with ${\hat {c}}\in \mathbb {R}$. We have
${\begin{aligned}{\hat {h}}(0)&=(\sin(0)-s(0))^{2}+(\cos(0)-c(0))^{2}\\&=(0-0)^{2}+(1-1)^{2}\\&=0^{2}+0^{2}=0\end{aligned}}$
So ${\hat {h}}(x)=(\sin(x)-s(x))^{2}+(\cos(x)-c(x))^{2}=0$. Now both $(\sin(x)-s(x))^{2}\geq 0$ and $(\cos(x)-c(x))^{2}\geq 0$ for all $x\in \in \mathbb {R}$. In order for the sum $(\sin(x)-s(x))^{2}+(\cos(x)-c(x))^{2}$ to be be zero, both summands $(\sin(x)-s(x))^{2}$ and $(\sin(x)-s(x))^{2}$ must be zero. That means
${\begin{aligned}(\sin(x)-s(x))^{2}=0\implies \sin(x)-s(x)=0\implies \sin(x)=s(x)\\(\cos(x)-c(x))^{2}=0\implies \cos(x)-c(x)=0\implies \cos(x)=c(x)\end{aligned}}$
So $s=\sin$ and $c=\cos$, which is what we wanted to show.