# Real Analysis/Differentiation

| ←Exercises | Real Analysis Differentiation | Applications of Derivatives→ |
In this chapter, we will introduce the concept of differentiation. Differentiation is a staple tool in calculus, which should be a fact somewhat familiar to you from studying earlier mathematics. However, the reasons as to why this is true have not always been so clearly proven. This chapter prove a simple consequence of differentiation you will be most familiar with - that is, we will focus on proving each differentiation "operations" that provides us a simple way to find the derivative for common functions.

## Definition

Let us define the derivative of a function.
Let $a\in \mathbb {R}$. Given a function $f:\mathbb {R} \to \mathbb {R}$, we say that ƒ(x) is differentiable at x=a if and only if $\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}$ exists.
The derivative of ƒ at a is denoted by $f'(a)$
A function is said to be differentiable on a set A if the derivative exists for each a in A. A function is differentiable if it is differentiable on its entire domain.

## Definition-Derived Theorems (Differentiability Implies Continuity)

Given our definition of a derivative, it should be noted that it utilizes limits and functions. This theorem relates derivation with continuity, which is useful for justifying many of the latter theorems that will be discussed in this chapter. The proof for this theorem is simple; it requires a valid limit converging to zero to mimic the continuity definition.
    Theorem Given a function ƒ which is differentiable at a, it is also continuous at a
The proof for this is as follows:
Proof that Differentiable Functions at a are Continuous at a :
| Differentiable definition: | ${\begin{aligned}f'(a)&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\\f'(a)\cdot \lim _{h\rightarrow 0}{h}&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\cdot \lim _{h\rightarrow 0}{h}\\f'(a)\cdot 0&=\lim _{h\rightarrow 0}{{\dfrac {f(a+h)-f(a)}{h}}\cdot h}\\0&=\lim _{h\rightarrow 0}{f(a+h)}-\lim _{h\rightarrow 0}{f(a)}\\\lim _{h\rightarrow 0}{f(a)}&=\lim _{h\rightarrow 0}{f(a+h)}\\\lim _{h\rightarrow 0}{f(a+h)}&=f(a)\end{aligned}}$ |
| Suppose we multiply both sides by 0 | ${\begin{aligned}f'(a)&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\\f'(a)\cdot \lim _{h\rightarrow 0}{h}&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\cdot \lim _{h\rightarrow 0}{h}\\f'(a)\cdot 0&=\lim _{h\rightarrow 0}{{\dfrac {f(a+h)-f(a)}{h}}\cdot h}\\0&=\lim _{h\rightarrow 0}{f(a+h)}-\lim _{h\rightarrow 0}{f(a)}\\\lim _{h\rightarrow 0}{f(a)}&=\lim _{h\rightarrow 0}{f(a+h)}\\\lim _{h\rightarrow 0}{f(a+h)}&=f(a)\end{aligned}}$ |
| Algebraic manipulations | ${\begin{aligned}f'(a)&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\\f'(a)\cdot \lim _{h\rightarrow 0}{h}&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\cdot \lim _{h\rightarrow 0}{h}\\f'(a)\cdot 0&=\lim _{h\rightarrow 0}{{\dfrac {f(a+h)-f(a)}{h}}\cdot h}\\0&=\lim _{h\rightarrow 0}{f(a+h)}-\lim _{h\rightarrow 0}{f(a)}\\\lim _{h\rightarrow 0}{f(a)}&=\lim _{h\rightarrow 0}{f(a+h)}\\\lim _{h\rightarrow 0}{f(a+h)}&=f(a)\end{aligned}}$ |
| The continuity definition $\blacksquare$ | ${\begin{aligned}f'(a)&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\\f'(a)\cdot \lim _{h\rightarrow 0}{h}&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\cdot \lim _{h\rightarrow 0}{h}\\f'(a)\cdot 0&=\lim _{h\rightarrow 0}{{\dfrac {f(a+h)-f(a)}{h}}\cdot h}\\0&=\lim _{h\rightarrow 0}{f(a+h)}-\lim _{h\rightarrow 0}{f(a)}\\\lim _{h\rightarrow 0}{f(a)}&=\lim _{h\rightarrow 0}{f(a+h)}\\\lim _{h\rightarrow 0}{f(a+h)}&=f(a)\end{aligned}}$ |
However, the converse is not true in this case. Analyzing the proof, it is apparent that a continuous function at a does not necessarily mean that it is differentiable at a simply because it would involve removing the multiplication by 0, which is impossible given our algebraic axioms.

## Properties of Differentiation

From this definition, we will create new properties of derivation. People familiar with Calculus should note that we are proving that the derivation of certain functions and operations are valid. These first theorems follow immediately from the definition.

### Basic Properties

Below are the list of properties which are mentioned only for completeness, and a demonstration of how the derivation formula works.
List of Basic Derivative :
| Constant Function | Given $f(x)=c,\quad f'(a)=0$ |
| Identity Function | Given $f(x)=x,\quad f'(a)=1$ |
Constant Function
Suppose a constant function ƒ such that $f(x)=c\quad \forall x\in \mathbb {R}$. This function will always have a derivative of 0 for any real number.
Given the derivation definition, we have
$f'=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}$
Applying the definition of the function, we can substitute the function for c, as such
${\begin{aligned}f'&=\lim _{h\rightarrow 0}{c-c \over h}\\&=\lim _{h\rightarrow 0}{0 \over h}\\&=0\\&\blacksquare \end{aligned}}$
Identity Function
Suppose an identity function ƒ such that $f(x)=x\quad \forall x\in \mathbb {R}$. This function will always have a derivative of 1 for any real number.
Given the derivation definition, we have
$f'=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}$
Applying the definition of the function, we can substitute the function for its input, as such
${\begin{aligned}f'&=\lim _{h\rightarrow 0}{a+h-a \over h}\\&=\lim _{h\rightarrow 0}{h \over h}\\&=\lim _{h\rightarrow 0}{1}\\&=1\\&\blacksquare \end{aligned}}$

### Algebraic Properties

Suppose two functions f and g that are differentiable at a, these following properties apply
List of Derivatives for Algebraic Operations :
| Addition | $(f+g)'(a)=f'(a)+g'(a)$ |
| Subtraction | $(f-g)'(a)=f'(a)-g'(a)$ |
| Product | $(fg)'(a)=f'(a)g(a)+f(a)g'(a)$ |
| Multiple of a Function | $(\lambda f)'(a)=\lambda \cdot f'(a)$ |
| Reciprocal | $\left({\dfrac {1}{f}}\right)'(a)=-{\dfrac {f'(a)}{f^{2}}}$ |
| Division | $\left({\dfrac {f}{g}}\right)'(a)={\dfrac {f'(a)g(a)-f(a)g'(a)}{g^{2}}}$ |
We will individually prove each one below
Addition
This proof essentially creates the definition of differentiation from the two functions that make up the overall function.
${\begin{aligned}(f+g)'(a)&=\lim _{h\rightarrow 0}{(f+g)(a+h)-(f+g)(a) \over h}\\&=\lim _{h\rightarrow 0}{(f(a+h)+g(a+h))-(f(a)+g(a)) \over h}\\&=\lim _{h\rightarrow 0}\left({f(a+h)-f(a) \over h}+{g(a+h)-g(a) \over h}\right)\\&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}+\lim _{h\rightarrow 0}{g(a+h)-g(a) \over h}\\&=f'(a)+g'(a)\\&\blacksquare \end{aligned}}$
Subtraction
We will not write out a rigorous proof for subtraction, given that it can be done mentally by imagining a negated $g(a)$ function or retracing the addition proof with subtraction instead.
Product
This proof works similarly to the previous proof, except that this proof requires the addition of extra terms which zero out when added together. This is a normal algebraic trick in order to derive theorems, which will be further used in the latter theorems in this chapter.
${\begin{aligned}(fg)'(x)&=\lim _{h\rightarrow 0}{f(a+h)g(a+h)-f(a)g(a) \over h}\\&{\text{next, we introduce the }}f(a)g(a+h){\text{ term into the statement}}\\&=\lim _{h\rightarrow 0}{f(a+h)g(a+h)-f(a)g(a+h)+f(a)g(a+h)-f(a)g(a) \over h}\\&=\lim _{h\rightarrow 0}{g(a+h)(f(a+h)-f(a))+f(a)(g(a+h)-g(a)) \over h}\\&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\lim _{h\rightarrow 0}{g(a+h)}+\lim _{h\rightarrow 0}{f(a)}\lim _{h\rightarrow 0}{g(a+h)-g(a) \over h}\\&=\lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}g(a+h)+f(a)\lim _{h\rightarrow 0}{g(a+h)-g(a) \over h}\\&=f'(x)g(x)+f(x)g'(x)\\&\blacksquare \end{aligned}}$
Product of a Constant
For this proof, we will present it using two different methods.
The first method requires only the limit theorem that a constant multiple is equivalent to the limit being multiplied by the constant.
${\begin{aligned}(\lambda f)'(a)&=\lim _{h\rightarrow 0}{\lambda f(a+h)-\lambda f(a) \over h}\\&=\lim _{h\rightarrow 0}{\lambda \left({\dfrac {f(a+h)-f(a)}{h}}\right)}\\&=\lambda \lim _{h\rightarrow 0}{f(a+h)-f(a) \over h}\\&=\lambda f'(x)\\&\blacksquare \end{aligned}}$
The second proof requires applying the product rule and constant function for differentiation.
${\begin{aligned}(\lambda f)'(a)&=g'(x)f(x)+g(x)f'(x)\\&=0\cdot f(x)+\lambda f'(x)\\&=\lambda f'(x)\\&\blacksquare \end{aligned}}$
Reciprocal
Like the other proofs before, this one will also invoke the definition at a certain point to simplify the statement into a concise, memorizable format.
${\begin{aligned}\left({\dfrac {1}{f}}\right)'(a)&=\lim _{h\rightarrow 0}{{\dfrac {1}{f(a+h)}}-{\dfrac {1}{f(a)}} \over h}\\&=\lim _{h\rightarrow 0}{\dfrac {f(a)-f(a+h)}{h\cdot f(a+h)f(a)}}\\&=\lim _{h\rightarrow 0}{{\dfrac {f(a)-f(a+h)}{h}}\cdot {\dfrac {1}{f(a+h)f(a)}}}\\&=\lim _{h\rightarrow 0}{-{\dfrac {f(a+h)-f(a)}{h}}}\cdot \lim _{h\rightarrow 0}{\dfrac {1}{f(a+h)f(a)}}\\&=-f'(a)\cdot {\dfrac {1}{f(a)f(a)}}\\&=-{\dfrac {f'(a)}{[f(a)]^{2}}}\\&\blacksquare \end{aligned}}$
Division
This proof borrows the reciprocal proof and the multiplication proof to form an easy to follow rationale.
${\begin{aligned}\left({\dfrac {f}{g}}\right)'(a)&=\left(f\cdot {\dfrac {1}{g}}\right)'(a)\\&=f'(a)\left({\dfrac {1}{g(a)}}\right)+{f(a) \over g'(a)}\\&=f'(a)\left({\dfrac {1}{g(a)}}\right)+f(a)\left({\dfrac {1}{g(a)}}\right)'\\&={\dfrac {f'(a)}{g(a)}}-{\dfrac {f(a)g'(a)}{[g(a)]^{2}}}\\&={\dfrac {f'(a)g(a)}{[g(a)]^{2}}}-{\dfrac {f(a)g'(a)}{[g(a)]^{2}}}\\&={\dfrac {f'(a)g(a)-f(a)g'(a)}{[g(a)]^{2}}}\\&\blacksquare \end{aligned}}$

### Chain Rule (Function Composition Theorem)

Given two functions f and g such that f is differentiable at $g(a)$ and g is differentiable at a, then $(f\circ g)'(a)=f'\circ g(a)\cdot g'(a)$
Proof Part 1
Unlike the previous properties, the chain rule will quickly become problematic and will definitely require an external theorem outside of algebraic manipulations to solve. To illustrate why a new theorem is required, we will begin to prove the Chain Rule though algebraic manipulations, point out the road block, then create a lemma to guide us around the issue, and thus figure out a proof. We begin with the following statements:
$(f\circ g)'(x)=\lim _{y\rightarrow x}{f(g(y))-f(g(x)) \over y-x}$ $=\lim _{y\rightarrow x}{f(g(y))-f(g(x)) \over g(y)-g(x)}{g(y)-g(x) \over y-x}$$=\lim _{y\rightarrow x}{f(g(y))-f(g(x)) \over g(y)-g(x)}\lim _{y\rightarrow x}{g(y)-g(x) \over y-x}$$=f'(g(x))g'(x)$
The problem is that $g(y)-g(x)$ may be zero at points arbitrarily close to x, and therefore ${f(g(y))-f(g(x)) \over g(y)-g(x)}$ would not be continuous at these points. Thus we apply a clever lemma as follows:

#### Caratheodory's Lemma

Let $f:\mathbb {R} \to \mathbb {R}$
We say that $f(x)$ is differentiable at $x=c$ if and only if there exists a continuous function $\phi :\mathbb {R} \to \mathbb {R}$ that satisfies
$(x-c)\phi (x)=f(x)-f(c)\forall x\in \mathbb {R}$
Proof
($\Rightarrow$)Let $f(x)$ be differentiable at $x=c$ and define function $\phi :\mathbb {R} \to \mathbb {R}$ such that
$\phi (x)={\frac {f(x)-f(c)}{x-c}}$ for $x\neq c$ and
$\phi (c)=f'(c)$
It is easy to see that $\phi (x)$ is continuous and that it satisfies the required condition.
($\Leftarrow$) Let $\phi (x)$ be a continuous function satisfying $(x-c)\phi (x)=f(x)-f(c)\forall x\in \mathbb {R}$
For all $x\neq c$, we have that $\phi (x)={\tfrac {f(x)-f(c)}{x-c}}$
As $\phi$ is continuous, $\phi (c)=\lim _{x\to c}\phi (x)$, that is,
$\phi (c)=\lim _{x\to c}{\frac {f(x)-f(c)}{x-c}}$ which implies that $f(x)$ is differentiable at $x=c$
Proof Part 2
Let $g:\mathbb {R} \to \mathbb {R}$ be differentiable at $c\in \mathbb {R}$
Let $f:\mathbb {R} \to \mathbb {R}$ be differentiable at $d=g(c)$
Let the domain of f be a subset of the image of g.
Then,
* $(f\circ g)(x)$ is differentiable at $x=c$
* $(f\circ g)'(c)=f'(g(c))g'(c)$
Caratheodory's Lemma implies that there exist continuous functions $\phi ,\gamma :\mathbb {R} \to \mathbb {R}$ such that $(x-c)\gamma (x)=g(x)-g(c)$ and $(g(x)-g(c))\phi (g(x))=f(g(x))-f(g(c))$
Now, consider the function $\eta (x)=\phi (g(x))\gamma (x)$. Obviously, $\eta (x)$ is continuous.
Also, it satisfies $(x-c)\eta (x)=(f\circ g)(x)-(f\circ g)(c)$. Hence, by Caratheodory's Lemma, $(f\circ g)(x)$ is differentiable at $x=c$ and that $(f\circ g)'(c)=\eta (c)=f'(g(c))g'(c)$

## Exercises

Here are some exercises to expand and train your understanding of the material.
* Find the derivatives of the following functions:
** A function of the form ƒ(x) = x$^n$
** Polynomial
** Trigonometric
** Exponential
** Logarithmic
* In this chapter you have learned that being able to take the derivative implies that the function is continuous at that point. Given this, please read Higher Order Derivatives before solving these problems
** Prove whether that the second derivative at a is also continuous at a
** Prove whether that the nth derivative at a is also continuous at a
* Some of the most popular counter examples to illustrate properties of continuity and differentiability are functions involving $f(x)=\sin \left({\tfrac {1}{x}}\right)$
** Prove that $f(x)=\sin \left({\tfrac {1}{x}}\right)\forall x\neq 0,f(0)=0$ is not continuous at $x=0$
** Prove that the function $f(x)=x\sin({\tfrac {1}{x}})\forall x\neq 0,f(0)=0$ is continuous but not differentiable at $x=0$
** Prove that $f(x)=x^{2}\sin \left({\tfrac {1}{x}}\right)\forall x\neq 0,f(0)=0$ is differentiable at $x=0$