# Math for Non-Geeks/ Computing derivatives

In the last chapter we defined the derivative function $f':D\to \mathbb {R}$ of another differentiable function $f:D\to \mathbb {R}$ as follows: $f'({\tilde {x}}):=\lim _{x\rightarrow {\tilde {x}}}{\tfrac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}}$. However, evaluating this limit can be a very cumbersome way to determine the derivative. For example, take the function $g:\mathbb {R} \to \mathbb {R}$ with $g(x)=x^{2}\cdot \ln(x)$. To calculate their derivatives we would have to determine $\lim _{x\rightarrow {\tilde {x}}}{\tfrac {x^{2}\cdot \ln(x)-{\tilde {x}}^{2}\cdot \ln({\tilde {x}})}{x-{\tilde {x}}}}$ for every ${\tilde {x}}\in \mathbb {R}$.
It would be great to apply some rules to directly find an expression for the derivative function, which saves us the differential quotient computation. And luckily there are indeed derivative rules that trace derivatives of a complicated function back to derivatives of some very basic functions that are known exactly.

## Overview

If $f$ and $g$ are differentiable functions, with the compositions $af$ (with $a\in \mathbb {R}$), $f+g$, $fg$, ${\tfrac {f}{g}}$ and $f\circ g$ being all well-defined and differentiable, Then the following derivative rules apply:
| Name | Regel |
| Factor rule | $(af)'=af'$ |
| Sum rule | $(f\pm g)'=f'\pm g'$ |
| Product rule | $(fg)'=f'g+fg'$ |
| Quotient rule | $\left({\frac {f}{g}}\right)'={\frac {gf'-fg'}{g^{2}}}$ |
| Inverse rule | $\left({\frac {1}{g}}\right)'=-{\frac {g'}{g^{2}}}$ |
| Chain rule | $(f\circ g)'=(f'\circ g)\cdot g'$ |
| Special cases of the chain rule | ${\begin{aligned}(f^{n})'&=nf^{n-1}\cdot f'\\({\sqrt {f}})'&={\frac {f'}{2{\sqrt {f}}}}\\(\exp \circ f)'&=(\exp \circ f)\cdot f'\\(\ln \circ f)'&={\tfrac {f'}{f}}\end{aligned}}$ |
| Inverse rule (yet missing) | $(f^{-1})'={\tfrac {1}{f'\circ f^{-1}}}$ |

## All rules at one glance

The derivatives rules can be explained in simple words:
* Factor rule $(af)'=af'$: The derivative is linear, so we can pull out any real (or even complex) number.
* Sum and difference rule $(f\pm g)'=f'\pm g'$: The derivative is linear, so for a sum, we can take the derivative of both summands separately.
* Product rule $(fg)'=f'g+fg'$: "Derive the first function and the second remains unchanged plus derive the second function and the first remains unchanged".
* Quotient rule $\left({\tfrac {f}{g}}\right)'={\tfrac {gf'-fg'}{g^{2}}}$: DDE-EDD is a simple memorization rule for the numerator ("denominator derivative enumerator minus enumerator derivative denominator")
* Inverse rule $\left({\frac {1}{g}}\right)'=-{\frac {g'}{g^{2}}}$: This is the special case of the quotient rule with $f\equiv 1$ (enumerator is constant $1$).
* Chain rule $(f\circ g)'=(f'\circ g)\cdot g'$: "Derive the outer function times derive the inner function". Caution, the derivative of the outer function must be taken with the inner function inserted ($f'(g(x))$). The differentiation of the inner function must not be forgotten either.

## Factor rule

Theorem (Factor product)
Let $f:D\to \mathbb {R}$ be a differentiable function with derivative $f':D\to \mathbb {R}$ and let $\lambda \in \mathbb {R}$ be a scalar factor. Then $(\lambda f)':D\to \mathbb {R}$ is differentiable and
$(\lambda f)'=\lambda f'$
Proof (Factor product)
We need to show that $\lim _{x\to {\tilde {x}}}{\tfrac {(\lambda f)(x)-(\lambda f)({\tilde {x}})}{x-{\tilde {x}}}}$ exists and equals $\lambda f'$. For ${\tilde {x}}\in D$ there is
${\begin{aligned}&\lim _{x\to {\tilde {x}}}{\frac {(\lambda f)({\tilde {x}})-(\lambda f)(x)}{{\tilde {x}}-x}}\\[0.3em]=\ &\lim _{x\to {\tilde {x}}}{\frac {\lambda f({\tilde {x}})-\lambda f(x)}{{\tilde {x}}-x}}\\[0.3em]=\ &\lim _{x\to {\tilde {x}}}{\lambda {\frac {f({\tilde {x}})-f(x)}{{\tilde {x}}-x}}}\\[0.3em]&{\color {Gray}\left\downarrow \ \lim _{x\to a}\lambda g(x)=\lambda \lim _{x\to a}g(x)\right.}\\[0.3em]=\ &\lambda \lim _{x\to {\tilde {x}}}{\frac {f({\tilde {x}})-f(x)}{{\tilde {x}}-x}}\\[0.3em]=\ &\lambda f'({\tilde {x}})\end{aligned}}$
So $(\lambda f)'=\lambda f'$.

## Sum rule
### Theorem

Now we want to determine the derivative of a function $g+f$, where $g:D\to \mathbb {R}$ and $f:D\to \mathbb {R}$ are both differentiable functions.
Theorem (Sum rule)
Let $f,g:D\to \mathbb {R}$ with $D\subseteq \mathbb {R}$ be two differentiable functions with derivatives $f':D\to \mathbb {R}$ and $g':D\to \mathbb {R}$. Then $f+g:D\to \mathbb {R}$ is differentiable and for all $x\in D$ there is:
$(f+g)'(x)=f'(x)+g'(x)$
Proof (Sum rule)
We need to prove that the limit $\lim _{x\to {\tilde {x}}}{\tfrac {(f+g)(x)-(f+g)({\tilde {x}})}{x-{\tilde {x}}}}$ exists. We have
${\begin{aligned}&\lim _{x\to {\tilde {x}}}{\frac {(f+g)(x)-(f+g)({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]=\ &\lim _{x\to {\tilde {x}}}{\frac {f(x)+g(x)-f({\tilde {x}})-g({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]=\ &\lim _{x\to {\tilde {x}}}{{\bigg{\frac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}}+{\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}}{\bigg )}}\\[0.3em]&{\color {Gray}\left\downarrow \ f{\text{ and }}g{\text{ are differentiable}}\right.}\\[0.3em]=\ &\lim _{x\to {\tilde {x}}}{\frac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}}+\lim _{x\to {\tilde {x}}}{\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]=\ &f'({\tilde {x}})+g'({\tilde {x}})\end{aligned}}$
So $(f+g)'(x)=f'(x)+g'(x)$.

### Example

Example (Sums of lines)
We consider two straight lines $f,g:\mathbb {R} \to \mathbb {R}$ with $f(x)=m_{1}x+t_{1}$ and $g(x)=m_{2}x+t_{2}$. Then
$(f+g)(x)=m_{1}x+t_{1}+m_{2}x+t_{2}=(m_{1}+m_{2})x+(t_{1}+t_{2})$
The derivative of a function at the position $x$ is the slope of the function at this position. The slope of the straight lines $f$ and $g$ are $m_{1}$ and $m_{2}$ respectively. So $f'(x)=m_{1}$ and $g'(x)=m_{2}$ for all $x\in \mathbb {R}$.
For the straight line $f+g$ , the slope is $m_{1}+m_{2}$ . So we have $(f+g)'(x)=m_{1}+m_{2}=f'(x)+g'(x)$. Hence, the summation rule holds for straight lines.

### Difference rule

Math for Non-Geeks: Template:Aufgabe

## Product rule

Theorem (Product rule)
Let $f:D\to \mathbb {R}$ and $g:D\to \mathbb {R}$ with $D\subseteq \mathbb {R}$ be differentiable functions with known derivative functions $f',g':D\to \mathbb {R}$. Then, $f\cdot g:D\to \mathbb {R} ,(f\cdot g)(x):=f(x)\cdot g(x)$ is differentiable and there is
$(f\cdot g)':D\to \mathbb {R} ,(f\cdot g)'(x)=f'(x)\cdot g(x)+g'(x)\cdot f(x)$
Proof (Product rule)
Let $x\in D$. Then, there is:
${\begin{aligned}&\lim _{x\rightarrow {\tilde {x}}}{\frac {(f\cdot g)(x)-(f\cdot g)({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{definition of }}(f\cdot g)\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{\frac {f(x)g(x)-f({\tilde {x}})g({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ -f({\tilde {x}})g(x)+f({\tilde {x}})g(x)=0\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{\frac {f(x)g(x)-f({\tilde {x}})g(x)+f({\tilde {x}})g(x)-f({\tilde {x}})g({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{{\frac {f(x)g(x)-f({\tilde {x}})g(x)}{x-{\tilde {x}}}}+{\frac {f({\tilde {x}})g(x)-f({\tilde {x}})g({\tilde {x}})}{x-{\tilde {x}}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{pull apart the limit}}\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{\frac {f(x)g(x)-f({\tilde {x}})g(x)}{x-{\tilde {x}}}}+\lim _{x\rightarrow {\tilde {x}}}{\frac {f({\tilde {x}})g(x)-f({\tilde {x}})g({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{factor out }}g(x){\text{ and }}f({\tilde {x}})\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{g(x){\frac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}}}+\lim _{x\rightarrow {\tilde {x}}}{f({\tilde {x}}){\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{limit theorems}}\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}\underbrace {g(x)} _{\to g({\tilde {x}})}\cdot \lim _{x\rightarrow {\tilde {x}}}\underbrace {\frac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}} _{\to f'({\tilde {x}})}+f({\tilde {x}})\cdot \lim _{x\rightarrow {\tilde {x}}}\underbrace {\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}} _{\to g'({\tilde {x}})}\\[0.3em]=\ &g({\tilde {x}})\cdot f'({\tilde {x}})+f({\tilde {x}})\cdot g'({\tilde {x}})\end{aligned}}$
In order to justify that the limits may be pulled apart, one must look at the calculation from back to front. Since all sub-expressions converge, the limit sets are allowed to be used.
Alternative proof (Product rule)
We look at any ${\tilde {x}}\in D$. Since $f$ and $g$ are differentiable according to the condition in ${\tilde {x}}$, there are functions $\delta _{f},\delta _{g}:D\to \mathbb {R}$, such that for all $x\in D$ there is
${\begin{aligned}&f(x)=f({\tilde {x}})+f'({\tilde {x}})\cdot (x-{\tilde {x}})+\delta _{f}(x)\\[0.3em]&g(x)=g({\tilde {x}})+g'({\tilde {x}})\cdot (x-{\tilde {x}})+\delta _{g}(x)\end{aligned}}$
In addition, there is $\lim _{x\to {\tilde {x}}}{\tfrac {\delta _{f}(x)}{x-{\tilde {x}}}}=0$ and $\lim _{x\to {\tilde {x}}}{\tfrac {\delta _{f}(x)}{x-{\tilde {x}}}}=0$. Hence, for all $x\in D$ we have
${\begin{aligned}&f(x)\cdot g(x)\\[0.3em]=\ &(f({\tilde {x}})+f'({\tilde {x}})\cdot (x-{\tilde {x}})+\delta _{f}(x))\cdot (g({\tilde {x}})+g'({\tilde {x}})\cdot (x-{\tilde {x}})+\delta _{g}(x))\\[0.3em]=\ &f({\tilde {x}})g({\tilde {x}})+(f'({\tilde {x}})g({\tilde {x}})+g'({\tilde {x}})f({\tilde {x}}))(x-{\tilde {x}})\\[0.3em]&+\delta _{f}(x)g'({\tilde {x}})(x-{\tilde {x}})+\delta _{g}(x)f'({\tilde {x}})(x-{\tilde {x}})+f'({\tilde {x}})g'({\tilde {x}}){(x-{\tilde {x}})}^{2}\\[0.3em]&+f({\tilde {x}})\delta _{g}(x)+g({\tilde {x}})\delta _{f}(x)+\delta _{f}(x)\delta _{g}(x)\end{aligned}}$
Now, we define the function $\delta _{f\cdot g}:D\to \mathbb {R}$ by
${\begin{aligned}\delta _{f\cdot g}(x):=&\delta _{f}(x)g'({\tilde {x}})(x-{\tilde {x}})+\delta _{g}(x)f'({\tilde {x}})(x-{\tilde {x}})+f'({\tilde {x}})g'({\tilde {x}}){(x-{\tilde {x}})}^{2}\\[0.3em]&+f({\tilde {x}})\delta _{g}(x)+g({\tilde {x}})\delta _{f}(x)+\delta _{f}(x)\delta _{g}(x)\end{aligned}}$
So for all $x\in D$:
$f(x)g(x)=f({\tilde {x}})g({\tilde {x}})+(f'({\tilde {x}})g({\tilde {x}})+g'({\tilde {x}})f({\tilde {x}}))(x-{\tilde {x}})+\delta _{f\cdot g}(x)$
If we can show that $\lim _{x\to {\tilde {x}}}{\tfrac {\delta _{f\cdot g}(x)}{x-{\tilde {x}}}}=0$, then $f\cdot g$ is differentiable at ${\tilde {x}}$ and $(f\cdot g)'({\tilde {x}})=f'({\tilde {x}})g({\tilde {x}})+g'({\tilde {x}})f({\tilde {x}})$. It is sufficient to show that all summands of the term $\delta _{f\cdot g}(x)$ converge faster than $x-{\tilde {x}}$ towards $0$:
${\begin{aligned}\lim _{x\to {\tilde {x}}}{\frac {\delta _{g}(x)f'({\tilde {x}})(x-{\tilde {x}})}{x-{\tilde {x}}}}&=\lim _{x\to {\tilde {x}}}{\underbrace {\delta _{f}(x)} _{\to 0}g'({\tilde {x}})}=0\\[0.5em]\lim _{x\to {\tilde {x}}}{\frac {\delta _{g}(x)f'({\tilde {x}})(x-{\tilde {x}})}{x-{\tilde {x}}}}&=\lim _{x\to {\tilde {x}}}{\underbrace {\delta _{g}(x)} _{\to 0}f'({\tilde {x}})}=0\\[0.5em]\lim _{x\to {\tilde {x}}}{\frac {f'({\tilde {x}})g'({\tilde {x}}){(x-{\tilde {x}})}^{2}}{x-{\tilde {x}}}}&=\lim _{x\to {\tilde {x}}}{f'({\tilde {x}})g'({\tilde {x}})\underbrace {(x-{\tilde {x}})} _{\to 0}}=0\\[0.5em]\lim _{x\to {\tilde {x}}}{\frac {f({\tilde {x}})\delta _{g}(x)}{x-{\tilde {x}}}}&=\lim _{x\to {\tilde {x}}}{f({\tilde {x}})\underbrace {\frac {\delta _{g}(x)}{x-{\tilde {x}}}} _{\to 0}}=0\\[0.5em]\lim _{x\to {\tilde {x}}}{\frac {g({\tilde {x}})\delta _{f}(x)}{x-{\tilde {x}}}}&=\lim _{x\to {\tilde {x}}}{g({\tilde {x}})\underbrace {\frac {\delta _{f}(x)}{x-{\tilde {x}}}} _{\to 0}}=0\\[0.5em]\lim _{x\to {\tilde {x}}}{\frac {\delta _{f}(x)\delta _{g}(x)}{x-{\tilde {x}}}}&=\lim _{x\to {\tilde {x}}}{\underbrace {\delta _{f}(x)} _{\to 0}\underbrace {\frac {\delta _{g}(x)}{x-{\tilde {x}}}} _{\to 0}}=0\\[0.5em]\end{aligned}}$

## Quotient rule

Theorem (Quotient rule)
Let $f,g:D\to \mathbb {R}$ be two differentiable functions with $g(x)\neq 0$ for all $x\in D$. Then the derivative of the function ${\tfrac {f}{g}}:D\to \mathbb {R}$, defined by $\left({\tfrac {f}{g}}\right)(x)={\tfrac {f(x)}{g(x)}}$, is differentiable and for $\left({\tfrac {f}{g}}\right)':D\to \mathbb {R}$ there is
$\left({\frac {f}{g}}\right)'(x)={\frac {f'(x)g(x)-f(x)g'(x)}{g^{2}(x)}}$
Here, $g^{2}(x)=g(x)\cdot g(x)$. In particular, we have the inverse rule:
$\left({\frac {1}{g}}\right)'(x)=-{\frac {g'(x)}{g^{2}(x)}}$
Proof (Quotient rule)
To prove the statement we first show that $\left({\tfrac {1}{g}}\right)'(x)=-{\tfrac {g'(x)}{g^{2}(x)}}$ holds. Here, $g:D\to \mathbb {R}$ is a differentiable function with $g(x)\neq 0$ for all $x\in D$. Let now ${\tilde {x}}\in D$. We consider $\lim _{x\to {\tilde {x}}}{\tfrac {\left({\tfrac {1}{g}}\right)(x)-\left({\tfrac {1}{g}}\right)({\tilde {x}})}{x-{\tilde {x}}}}$. There is
${\begin{aligned}&\lim _{x\to {\tilde {x}}}{\frac {\left({\frac {1}{g}}\right)(x)-\left({\frac {1}{g}}\right)({\tilde {x}})}{x-{\tilde {x}}}}\\[0.5em]=\ &\lim _{x\to {\tilde {x}}}{\frac {{\frac {1}{g(x)}}-{\frac {1}{g({\tilde {x}})}}}{x-{\tilde {x}}}}\\[0.5em]=\ &\lim _{x\to {\tilde {x}}}{\frac {\frac {g({\tilde {x}})-g(x)}{g(x)\cdot g({\tilde {x}})}}{x-{\tilde {x}}}}\\[0.5em]=\ &\lim _{x\to {\tilde {x}}}{\frac {g({\tilde {x}})-g(x)}{g({\tilde {x}})\cdot g(x)(x-{\tilde {x}})}}\\[0.5em]=\ &\lim _{x\to {\tilde {x}}}{\left(-{\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}}\cdot {\frac {1}{g({\tilde {x}})g(x)}}\right)}\\[0.5em]&{\color {Gray}\left\downarrow \ {\text{limit theorems}}\right.}\\[0.5em]=\ &\lim _{x\to {\tilde {x}}}{\left(-{\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}}\right)}\cdot \lim _{x\to {\tilde {x}}}{\frac {1}{g({\tilde {x}})g(x)}}\\[0.5em]&{\color {Gray}\left\downarrow \ {\text{factor rule}}\right.}\\[0.5em]=\ &-\lim _{x\to {\tilde {x}}}\underbrace {\frac {g(x)-g({\tilde {x}})}{x-{\tilde {x}}}} _{\to g'({\tilde {x}})}\cdot {\frac {1}{g({\tilde {x}})\lim _{x\to {\tilde {x}}}\underbrace {g(x)} _{\to g({\tilde {x}})}}}\\[0.5em]=\ &-g'({\tilde {x}}){\frac {1}{g({\tilde {x}})g({\tilde {x}})}}\\[0.5em]=\ &-{\frac {g'({\tilde {x}})}{g^{2}({\tilde {x}})}}\end{aligned}}$
In the end, we see that all sub-expressions converge. That is why the limit theorems are allowed to be used. Now we derive the quotient rule for ${\tfrac {f}{g}}{g}$ from this. Here we have $f,g:D\to \mathbb {R}$ and $g(x)\neq 0$ for all $x\in D$. The quotient rule can then be derived from the product rule:
${\begin{aligned}&\left({\frac {f}{g}}\right)'(x)=\left({\frac {f(x)}{g(x)}}\right)'=\left(f(x)\cdot {\frac {1}{g(x)}}\right)'\\[0.5em]&{\color {Gray}\left\downarrow \ {\text{product rule}}\right.}\\[0.5em]=\ &f'(x)\cdot {\frac {1}{g(x)}}+f(x)\left(-{\frac {g'(x)}{g^{2}(x)}}\right)\\[0.5em]=\ &{\frac {f'(x)g(x)-f(x)g'(x)}{g^{2}(x)}}\end{aligned}}$

## Chain rule

Theorem (Chain rule)
Let $f:A\to B$ and $g:C\to D$ be two real-valued and differentiable functions with $A,B,C,D\subseteq \mathbb {R}$ and $f(A)\subseteq C$. Then, for the derivative function of $g\circ f:A\to D$, there is:
$(g\circ f)':A\to \mathbb {R} ,(g\circ f)'(x)=g'(f(x))\cdot f'(x)$
How to get to the proof? (Chain rule)
We could first try to conduct the proof directly via the differential quotient:
${\begin{aligned}&\lim _{x\rightarrow {\tilde {x}}}{\frac {(g\circ f)(x)-(g\circ f)({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{\frac {(g(f(x))-(g(f({\tilde {x}}))}{x-{\tilde {x}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{expand by }}f(x)-f({\tilde {x}})\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{{\frac {(g(f(x))-(g(f({\tilde {x}}))}{f(x)-f({\tilde {x}})}}\cdot {\frac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{limit theorems}}\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}\underbrace {\frac {(g(f(x))-(g(f({\tilde {x}}))}{f(x)-f({\tilde {x}})}} _{\to g'(f({\tilde {x}}))}\cdot \lim _{x\rightarrow {\tilde {x}}}\underbrace {\frac {f(x)-f({\tilde {x}})}{x-{\tilde {x}}}} _{\to f'({\tilde {x}})}\\[0.3em]=\ &g'(f({\tilde {x}}))\cdot f'({\tilde {x}})\end{aligned}}$
These arithmetic steps reflect the basic idea behind a proof of the chain rule. But this argumentation is problematic (i.e. wrong) for several reasons:
* We expand by $f(x)-f({\tilde {x}})$. But what happens if $f({\tilde {x}})=f(x)$? Then we have expanded by zero, which is not allowed. So the found limit value doesn't need to be correct any more.
* In the last step we claim that $\lim _{\color {Orange}x\rightarrow {\tilde {x}}}{\tfrac {g(f(x))-(g(f({\tilde {x}})}{f(x)-f({\tilde {x}})}}=g'(f({\tilde {x}}))$ would hold. All we know is that $\lim _{\color {OliveGreen}f(x)\rightarrow f({\tilde {x}})}{\tfrac {g(f(x))-(g(f({\tilde {x}})}{f(x)-f({\tilde {x}})}}=g'(f({\tilde {x}}))$, but we cannot say anything about how this limit value behaves in the limit $x\to {\tilde {x}}$ instead of $f(x)\to f({\tilde {x}})$.
To save the proof, we take a way around, using an auxiliary function. This function will be well defined at the position ${\tilde {x}}$, so we avoid the extension with $f(x)-f({\tilde {x}})$.
Proof (Chain rule)
Let ${\tilde {x}}\in A$. We define the following auxiliary function:
${\tilde {g}}:C\to \mathbb {R} ,u\mapsto {\begin{cases}{\frac {g(u)-g(f({\tilde {x}}))}{u-f({\tilde {x}})}}&;u\neq f({\tilde {x}})\\g'(f({\tilde {x}}))&;u=f({\tilde {x}})\end{cases}}$
Then, there is for all $u\in C$:
$g(u)-g(f({\tilde {x}}))={\tilde {g}}(u)\cdot (u-f({\tilde {x}}))$
Further, ${\tilde {g}}$ is continuous at all $u\neq f({\tilde {x}})$: it is just a combination of continuous functions.${\tilde {g}}$ is even continuous at $u=f({\tilde {x}})$, since differentiability of $g$ implies
$\lim _{u\to f({\tilde {x}})}{{\tilde {g}}(u)}=\lim _{u\to f({\tilde {x}})}{\frac {g(u)-g(f({\tilde {x}}))}{u-f({\tilde {x}})}}=g'(f({\tilde {x}}))={\tilde {g}}(f({\tilde {x}}))$
So:
${\begin{aligned}&\lim _{x\rightarrow {\tilde {x}}}{\frac {(g\circ f)(x)-(g\circ f)({\tilde {x}})}{x-{\tilde {x}}}}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{\frac {(g(f(x))-(g(f({\tilde {x}}))}{x-{\tilde {x}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ g(f(x))-(g(f({\tilde {x}}))={\tilde {g}}(f(x))\cdot (f(x)-f({\tilde {x}}))\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}{\frac {{\tilde {g}}(f(x))\cdot (f(x)-f({\tilde {x}}))}{x-{\tilde {x}}}}\\[0.3em]&{\color {Gray}\left\downarrow \ {\text{limit theorems}}\right.}\\[0.3em]=\ &\lim _{x\rightarrow {\tilde {x}}}\underbrace {\frac {(f(x)-f({\tilde {x}}))}{x-{\tilde {x}}}} _{\to f'({\tilde {x}})}\cdot \lim _{x\rightarrow {\tilde {x}}}{{\tilde {g}}(f(x))}\\[0.3em]=\ &f'({\tilde {x}})\cdot \lim _{x\rightarrow {\tilde {x}}}{{\tilde {g}}(f(x))}\\[0.3em]&{\color {Gray}\left\downarrow \ {\tilde {g}}{\text{ is continuous}}\right.}\\[0.3em]=\ &f'({\tilde {x}})\cdot {\tilde {g}}\left(\lim _{x\rightarrow {\tilde {x}}}{f(x)}\right)\\[0.3em]&{\color {Gray}\left\downarrow \ f{\text{ is continuous }}\right.}\\[0.3em]=\ &f'({\tilde {x}})\cdot {\tilde {g}}(f({\tilde {x}}))\\[0.3em]=\ &f'({\tilde {x}})\cdot g'(f({\tilde {x}}))\end{aligned}}$
Alternative proof (Chain rule)
Let ${\tilde {x}}\in A$. Since $f$ and $g$ are differentiable , there are functions $\delta _{f}:{\tilde {A}}:=\lbrace a-{\tilde {x}}|a\in A\rbrace \to \mathbb {R}$ and $\delta _{g}:{\tilde {C}}:=\lbrace c-f({\tilde {x}})|c\in C\rbrace \to \mathbb {R}$, such that for all $h\in {\tilde {A}}$ and all $i\in {\tilde {C}}$ there is
${\begin{aligned}&f({\tilde {x}}+h)=f({\tilde {x}})+f'({\tilde {x}})\cdot h+\delta _{f}(h)\\[0.3em]&g(f({\tilde {x}})+i)=g(f({\tilde {x}}))+g'(f({\tilde {x}}))\cdot i+\delta _{g}(i)\end{aligned}}$
In addition $\lim _{h\to 0}{\tfrac {\delta _{f}(h)}{h}}=0$ as well as $\lim _{i\to 0}{\tfrac {\delta _{g}(i)}{i}}=0$. So:
${\begin{aligned}&(g\circ f)({\tilde {x}}+h)\\[0.3em]=\ &g(f({\tilde {x}})+f'({\tilde {x}})\cdot h+\delta _{f}(h))\\[0.3em]=\ &g(f({\tilde {x}}))+g'(f({\tilde {x}}))\cdot (f'({\tilde {x}})\cdot h+\delta _{f}(h))+\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))\\[0.3em]=\ &g(f({\tilde {x}}))+g'(f({\tilde {x}}))f'({\tilde {x}})h+g'(f({\tilde {x}}))\delta _{f}(h)+\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))\\[0.3em]\end{aligned}}$
We now define
$\delta _{g\circ f}:{\tilde {A}}\to \mathbb {R} ,x\mapsto g'(f({\tilde {x}}))\delta _{f}(h)+\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))$
In order to prove that $g\circ f$ is differentiable at ${\tilde {x}}$ with $(g\circ f)'({\tilde {x}})=g'(f({\tilde {x}}))f'({\tilde {x}})$ we need to show that $\lim _{h\to 0}{\tfrac {\delta _{g\circ f}(h)}{h}}=0$ holds. There is:
${\begin{aligned}&\lim _{h\to 0}{\frac {\delta _{g\circ f}(h)}{h}}\\[0.5em]=\ &\lim _{h\to 0}{\frac {g'(f({\tilde {x}}))\delta _{f}(h)+\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))}{h}}\\[0.5em]&{\color {Gray}\left\downarrow \ {\text{pull apart the limit}}\right.}\\[0.5em]=\ &\lim _{h\to 0}{\frac {g'(f({\tilde {x}}))\delta _{f}(h)}{h}}+\lim _{h\to 0}{\frac {\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))}{h}}\\[0.5em]=\ &g'(f({\tilde {x}}))\lim _{h\to 0}{\frac {\delta _{f}(h)}{h}}+\lim _{h\to 0}{\frac {\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))}{h}}\\[0.5em]&{\color {Gray}\left\downarrow \ \lim _{h\to 0}{\frac {\delta _{f}(h)}{h}}=0\right.}\\[0.5em]=\ &g'(f({\tilde {x}}))\cdot 0+\lim _{h\to 0}{\frac {\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))}{h}}\\[0.5em]=\ &\lim _{h\to 0}{\frac {\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))}{h}}\end{aligned}}$
To calculate this limit, we consider any sequence $(h_{n})_{n\in \mathbb {N} }$ in $\mathbb {R} \setminus \{0\}$ which converges towards $0$. For all $n\in \mathbb {N}$ with $f'({\tilde {x}})\cdot h_{n}+\delta _{f}(h_{n})=0$ , there is $\delta _{g}(0)=0$ so ${\tfrac {\delta _{g}(f'({\tilde {x}})\cdot h_{n}+\delta _{f}(h_{n}))}{h_{n}}}=0$.
If only there are finally many $n\in \mathbb {N}$ with ${\tfrac {\delta _{g}(f'({\tilde {x}})\cdot h_{n}+\delta _{f}(h_{n}))}{h_{n}}}\neq 0$, then we have $\lim _{n\to \infty }{\tfrac {\delta _{g}(f'({\tilde {x}})\cdot h_{n}+\delta _{f}(h_{n}))}{h_{n}}}=0$. So let us consider the case that for infinitely many $n\in \mathbb {N}$ there is ${\tfrac {\delta _{g}(f'({\tilde {x}})\cdot h_{n}+\delta _{f}(h_{n}))}{h_{n}}}\neq is0$. Let $(h_{n_{k}})_{k\in \mathbb {N} }$ be the subsequence of elements of $(h_{n})_{n\in \mathbb {N} }$ with $\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))\neq 0$. There is
${\begin{aligned}&\lim _{k\to \infty }{\frac {\delta _{g}(f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}}))}{h_{n_{k}}}}\\[0.5em]=\ &\lim _{k\to \infty }{{\frac {\delta _{g}(f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}}))}{f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}})}}\cdot {\frac {f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}})}{h_{n_{k}}}}}\\[0.5em]&{\color {Gray}\left\downarrow \ {\text{pull apart the limit}}\right.}\\[0.5em]=\ &\lim _{k\to \infty }{\frac {\delta _{g}(f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}}))}{f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}})}}\cdot \lim _{k\to \infty }{\frac {f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}})}{h_{n_{k}}}}\\[0.5em]&{\color {Gray}\left\downarrow \ {\text{since}}\lim _{k\to \infty }{h_{n_{k}}}=0{\text{ there is }}\lim _{k\to \infty }{f'({\tilde {x}})\cdot h_{n_{k}}+\delta _{f}(h_{n_{k}})}=0\right.}\\[0.5em]=\ &\lim _{{\hat {h}}\to 0}{\frac {\delta _{g}({\hat {h}})}{\hat {h}}}\cdot \left(\lim _{k\to \infty }{\frac {f'({\tilde {x}})\cdot h_{n_{k}}}{h_{n_{k}}}}+\lim _{k\to \infty }{\frac {\delta _{f}(h_{n_{k}})}{h_{n_{k}}}}\right)\\[0.5em]&{\color {Gray}\left\downarrow \ \lim _{{\hat {h}}\to 0}{\frac {\delta _{g}({\hat {h}})}{\hat {h}}}=0{\text{ and }}\lim _{k\to \infty }{h_{n_{k}}}=0\right.}\\[0.5em]=\ &0\cdot \left(f'({\tilde {x}})+\lim _{{\tilde {h}}\to 0}{\frac {\delta _{f}({\tilde {h}})}{\tilde {h}}}\right)\\[0.5em]&{\color {Gray}\left\downarrow \ \lim _{{\tilde {h}}\to 0}{\frac {\delta _{g}({\tilde {h}})}{\tilde {h}}}=0\ \right.}\\[0.5em]=\ &0\cdot \left(f'({\tilde {x}})+0\right)\\[0.5em]=\ &0\end{aligned}}$
So we have
$\lim _{h\to 0}{\frac {\delta _{g}(f'({\tilde {x}})\cdot h+\delta _{f}(h))}{h}}=0$
Hint
Using the chain rule, we may prove the inverse rule $\left({\tfrac {1}{f}}\right)'=-{\tfrac {f'}{f^{2}}}$ . If we set the "outer function" $g(x)={\tfrac {1}{x}}$, then there is $g'(x)=-{\tfrac {1}{x^{2}}}$. So we have
${\begin{aligned}\left({\tfrac {1}{f}}\right)'(x)&=(g\circ f)'(x)=g'(f(x))\cdot f'(x)\\[0.3em]&=-{\tfrac {1}{f^{2}(x)}}\cdot f'(x)=-{\tfrac {f'(x)}{f^{2}(x)}}\end{aligned}}$
We used this rule above to derive the quotient rule. That means, the quotient rule can be shown with the chain rule and the product rule at hand. Conversely, we may prove the product rule using the chain rule. For the exercise we recommend our exercise (yet missing).