12.9 Derivatives
Derivatives
Differentiable
Let \(f:(a,b)\rightarrow \R\) and \(x_0\in(a,b)\), we say that \(f\) is differentiable at \(x_0\) if \(\lim_{x\to x_0}\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}\) exists or \(\lim_{h\to0}\frac{f\left(x_0+h\right)-f\left(x_0\right)}{h}\) exists
In this case we call the limit \(f'(x_0)\)
We say that \(f\) is differentiable on \((a,b)\) if it is differentiable at \(x_0\) \(\forall x_0\in(a,b)\)
Graph
Thus \(f'(x_0)"="\) slope of the tangent line of the graph of \(f\) at the point \(x_0\)
Note
If \(f\) is differentiable on \((a,b)\) we obtain a new function \(f^{\prime}:(a,b)\rightarrow\mathbb{R},\quad f^{\prime}(x)=\lim_{x\to x_0}\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}\quad\forall x_0\in\left(a,b\right)\)
Then we have \(f'(x)=\lim_{h\to0}\frac{f\left(x_0+h\right)-f\left(x_0\right)}{h}\), this function is called the derivative of \(f\)
Example
If \(f(x)\) is the amount of something, \(\frac{f(x+h)-f(x)}{h}\) is the mean of the rate of change of \(f\)
Notation
\(f^{\prime}(x)=\dot{f}(x)=\frac{\mathrm{d}f}{\mathrm{d}x}=\frac{df}{\mathrm{d}t}\vert_{t=x}\)
Example
-
\(f(x)=c\)
Since \(\lim_{x\to x_0}\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}=\lim_{x\to x_0}\frac{c-c}{x-x_0}=0\) since \(x-x_0\neq 0\)\, thus the limit exists.
Then \(f'(x_0)=0\), thus \(f'(x)=0,\forall x\)
-
\(f(x)=ax+b\)
\(\lim_{h\to0}\frac{f\left(x+h\right)-f\left(x\right)}{h}=\lim_{h\to0}\frac{a\left(x+h\right)+b-\left(ax+b\right)}{h}=\lim_{h\to0}\frac{ah}{h}=a\)
Thus \(f'(x)=a\)
-
\(f(x)=x^2\)
\(\lim_{x\to x_0}\frac{x^2-x_0^2}{x-x_0}=\lim_{x\to x_0}\left(x+x_0\right)=2x_0\), thus \(f'(x)=2x_0\)
We use \(x\to x_0\) instead of \(h\to 0\) because it's easier to calculate since we can use difference of square root formula
But if we use \(\lim_{h\to0}\frac{f\left(x+h\right)-f\left(x\right)}{h}=\lim_{h\to0}\frac{\left(x+h\right)^2-x^2}{h}=\lim_{h\to0}\frac{2hx+h^2}{h}=\lim_{h\to0}\left(2x+h\right)=2x\), it also works
-
\(f(x)=\frac{1}{\sqrt{x}}\)
\(\lim_{x\to x_0}\frac{\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{x_0}}}{x-x_0}=\lim_{x\to x_0}\frac{\frac{\sqrt{x_0}-\sqrt{x}}{\sqrt{x_0}\sqrt{x}}}{\left(\sqrt{x}-\sqrt{x_0}\right)\left(\sqrt{x}+\sqrt{x_0}\right)}=\lim_{x\to x_0}\frac{\frac{-1}{\sqrt{x_0}\sqrt{x}}}{\sqrt{x}+\sqrt{x_0}}=\lim_{x\to x_0}\frac{-1}{\left(\sqrt{x}+\sqrt{x_0}\right)\sqrt{x_0}\sqrt{x}}=\lim_{x\to x_0}\frac{-1}{x\sqrt{x_0}+x_0\sqrt{x}}=-\frac{1}{2x_0\sqrt{x_0}}\)
Thus \(f'(x)=-\frac{1}{2x_0\sqrt{x_0}}\)
\(\frac{\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{x_0}}}{x-x_0}\) is not exact equal to \(\frac{-1}{x\sqrt{x_0}+x_0\sqrt{x}}\) since \(x_0\) is not defined in the first one but defined in the second one
But we can still take the limit since we don't care whether \(x\) can take \(x_0\) because the limit only requires us to get very close to \(x_0\)
Thus the difference is the domain of first one doesn't contain \(x_0\) but the second one does
-
\(f(x)=|x|\)
\(f\) is not differentiable at \(x_0=0\) since \(\lim_{x\to x_0}\frac{\left|x\right|-\left|x_0\right|}{x-x_0}=\lim_{x\to0}\frac{\left|x\right|}{x}=\lim_{x\to0}\begin{cases}1\quad x>0\\-1\quad x<0\end{cases}\)
Thus there is no limit
Thus \(f^{\prime}(x)=\begin{cases}1\quad x>0\\\text{Not defined}\quad x=0\\-1\quad x<0\end{cases}\)
Algebra of Derivatives
Theorem
Let \(f,g:(a,b)\rightarrow \R\) be differentiable functions at \(x_0\in(a,b)\). Then
-
\((\alpha f+\beta g)\) is differentiable at \(x_0\) and \((\alpha f+\beta g)'(x_0)=\alpha f'(x_0)+\beta g'(x_0),\forall \alpha,\beta \in \R\)
Proof
exercise
-
\(f,g\) is differentiable at \(x_0\) and \((f\cdot g)'(x_0)=f'(x_0)g(x_0)+f(x_0)g'(x_0)\)
Proof
\((f\cdot g)^{\prime}(x_0)=\lim_{x\to x_0}\frac{\left(f\cdot g\left)\left(x\right)-\left(f\cdot g\right)\left(x_0\right)\right.\right.}{x-x_0}=\lim_{x\to x_0}\frac{f\left(x\right)\cdot g\left(x\right)-f\left(x_0\right)\cdot g\left(x_0\right)}{x-x_0}=\lim_{x\to x_0}\frac{f\left(x\right)\cdot g\left(x\right)-f\left(x\right)g\left(x_0\right)+f\left(x\right)g\left(x_0\right)-f\left(x_0\right)\cdot g\left(x_0\right)}{x-x_0}\)
\(=\lim_{x\to x_0}f\left(x\right)\frac{g\left(x\right)-g\left(x_0\right)}{x-x_0}+\lim_{x\to x_0}g\left(x\right)\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}\)
By proposition, then \(\lim_{x\to x_0}f\left(x\right)=f\left(x_0\right)\)
Thus \((f\cdot g)^{\prime}(x_0)=f^{\prime}(x_0)g(x_0)+f(x_0)g^{\prime}(x_0)\)
-
If \(g(x_0)\neq 0\), then \(\frac{f}{g}\) is differentiable at \(x_0\) and \((\frac{f}{g})^{\prime}(x_0)=\frac{f^{\prime}\left(x_0\right)g\left(x_0\right)-f\left(x_0\right)g^{\prime}\left(x_0\right)}{g\left(x_0\right)^2}\)
Let us prove \(\left(\frac{1}{g}\right)^{\prime}\left(x_0\right)=\frac{-g^{\prime}\left(x_0\right)}{g\left(x_0\right)^2}\) first
\(\lim_{x\to x_0}\frac{\frac{1}{g\left(x\right)}-\frac{1}{g\left(x_0\right)}}{x-x_0}=\lim_{x\to x_0}\frac{g\left(x_0\right)-g\left(x\right)}{g\left(x\right)g\left(x_0\right)\left(x-x_0\right)}=\lim_{x\to x_0}\frac{g\left(x_0)-g\left(x\right.\right)}{x-x_0}\cdot\lim_{x\to x_0}\frac{1}{g\left(x\right)g\left(x_0\right)}=\frac{-g^{\prime}\left(x_0\right)}{g\left(x_0\right)^2}\)
Then we combine this and (2) we can prove it
Proposition
If \(f:(a,b)\to \R\) is differentiable at \(x_0\in(a,b)\Rightarrow f\) is continuous at \(x_0\)
Proof
We know that \(\lim_{x\to x_0}\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}\) exists (is \(f'(x)\))
We want to see that \(\lim_{x\to x_0}f\left(x\right)=f\left(x_0\right)\) where \(x_0\) is a limit point in \((a,b)\)
Thus we need to prove \(\lim_{x\to x_0}f\left(x\right)-f\left(x_0\right)=0\)
\(\lim_{x\to x_0}f\left(x\right)-f\left(x_0\right)=\lim_{x\to x_0}\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}\left(x-x_0\right)\) since \(x\neq x_0\)
Then \(=\lim_{x\to x_0}\frac{f\left(x\right)-f\left(x_0\right)}{x-x_0}\lim_{x\to x_0}\left(x-x_0\right)=0\)
Example
-
\(f(x)=x^2=x\cdot x\), then \(f'(x)=g'(x)\cdot g(x)+g(x)\cdot g'(x)=2x\)
Claim: \(f(x)=x^{n}\Rightarrow f^{\prime}\left(x\right)=nx^{n-1}\)
Proof
Use induction: For \(n=1,2\) \(\checkmark\)
\(f(x)=x^{n}=x\cdot x^{n-1}\), then \(f^{\prime}(x)=1\cdot x^{n-1}+x(n-1)x^{n-1}=nx^{n-1}\)
-
\(f(x)=\frac{3x^2+x-4}{2x^3+1}\) \(f^{\prime}(x)=\frac{\left(3\cdot2x+1\right)\left(2x^3+1\right)-\left(3x^2+x-4\right)6x^2}{\left(2x^3+1\right)^2}=\ldots\)
Chain Rule
Let \(g:(a,b)\rightarrow (c,d)\) and \(f:(c,d)\rightarrow \R\) such that \(g\) is differentiable at \(x_0\in(a,b)\) and \(f\) is differentiable at \(y_0=g(x_0)\in (c,d)\)
Then \(f\circ g\) is differentiable at \(x_0\) and \(\left(f\circ g\right)^{\prime}\left(x_0\right)=f^{\prime}\left(g\left(x_0\right)\right)\cdot g^{\prime}\left(x_0\right)\)
Proof
\(\lim_{x\to x_0}\frac{(f\circ g)(x)-(f\circ g)(x_0)}{x-x_0}=\lim_{x\to x_0}\frac{f\left(g\left(x\right)\right)-f\left(g\left(x_0\right)\right)}{x-x_0}=\lim_{x\to x_0}\frac{\left(g\left(x\right)-g\left(x_0\right)\right)\left(f\left(g\left(x\right)\right)-f\left(g\left(x_0\right)\right)\right)}{\left(x-x_0\right)\left(g\left(x\right)-g\left(x_0\right)\right)}\)
\(=\lim_{x\to x_0}\frac{f\left(g\left(x\right)\right)-f\left(g\left(x_0\right)\right)}{g\left(x\right)-g\left(x_0\right)}\cdot\lim_{x\to x_0}\frac{g\left(x\right)-g\left(x_0\right)}{x-x_0}=\lim_{x\to x_0}\frac{f\left(y\right)-f\left(y_0\right)}{y-y_0}\cdot\lim_{x\to x_0}\frac{g\left(x\right)-g\left(x_0\right)}{x-x_0}=f^{\prime}\left(y_0\right)\cdot g^{\prime}\left(x_0\right)\)
But \(g(x)-g(x_0)\) may be \(0\) error!
Let \(\phi(x)=\begin{cases}\lim_{x\to x_0}\frac{f\left(g\left(x\right)\right)-f\left(g\left(x_0\right)\right)}{g\left(x\right)-g\left(x_0\right)}\quad\text{if }g\left(x\right)\neq g\left(x_0\right)\\ f^{\prime}\left(g\left(x_0\right)\right)\quad\text{if }g\left(x\right)=g\left(x_0\right)\end{cases}\)
Now \(\phi:(a,b)\rightarrow \R\)
We are going to prove that \(\phi(x)\) is continuous at \(x_0\) that is \(\lim_{x\to x_0}\phi\left(x\right)=\phi\left(x_0\right)\overset{def}{=}f'(g(x_0))\)
Thus we need to find \(\delta>0\) such that \(|x-x_0|<\delta\Rightarrow\left|\phi(x)-\phi(x_0)\right|<\varepsilon\)
We know \(f\) is differentiable at \(y_0=g(x_0)\), then \(\lim_{y\to y_0}\frac{f\left(y\right)-f\left(y_0\right)}{y-y_0}=f^{\prime}\left(y_0\right)\)
Then \(\forall \varepsilon_1>0,\exists \delta_1>0\) such that \(0<|y-y_0|<\delta_1\) such that \(|\frac{f\left(y\right)-f\left(y_0\right)}{y-y_0}-f^{\prime}\left(y_0\right)|<\varepsilon_1\)
Similarly, \(g\) is differentiable at \(x_0\), then \(g\) is continuous at \(x_0\), then \(\lim_{x\to x_0}g\left(x\right)=g\left(x_0\right)=y_0\)
Then \(\forall \varepsilon_2>0,\exists \delta_2>0\) such that \(|x-x_0|<\delta_2\), then \(|g(x)-g(x_0)|<\varepsilon_2\)
Thus we use this two things
Given \(\varepsilon > 0\), we want to obtain \(\delta\) such that \(|x-x_0|<\delta\) then \(|g(x)-g(x_0)|<\varepsilon\)
Let \(\varepsilon_1=\varepsilon,\varepsilon_2=\delta_1,\delta=\delta_2\)
Then let's check
Given \(\varepsilon > 0\), \(\exists \delta_2\) such that \(|x-x_0|<\delta_2\) then \(|g(x)-g(x_0)|<\varepsilon_2=\delta_1\), then if in case \(g(x)\neq g(x_0)\), then \(|\frac{f\left(g\left(x\right)\right)-f\left(g\left(x\right)\right)}{g\left(x\right)-g\left(x_0\right)}-f^{\prime}\left(y_0\right)|<\varepsilon_1=\varepsilon\)
Then by definition, we have \(|\phi\left(x\right)-f^{\prime}\left(y_0\right)|<\varepsilon\) where \(f'(y_0)=\phi(x_0)\), then \(|\phi\left(x\right)-\phi\left(x_0\right)|<\varepsilon\)
And if \(g(x)=g(x_0)\), then by definition \(\phi(x)=f(y_0)=\phi(x_0)\), then \(|\phi\left(x\right)-\phi\left(x_0\right)|=0<\varepsilon\)
Finally, we conclude that \(|x-x_0|<\delta\), then \(|\phi\left(x\right)-\phi\left(x_0\right)|<\varepsilon\)
Now, we check: \(\lim_{x\to x_0}\frac{(f\circ g)(x)-(f\circ g)(x_0)}{x-x_0}=\lim_{x\to x_0}\frac{f\left(g\left(x\right)\right)-f\left(g\left(x_0\right)\right)}{x-x_0}=\lim_{x\to x_0}\frac{\phi\left(x\right)\left(g\left(x\right)-g\left(x_0\right)\right)}{x-x_0}=\lim_{x\to x_0}\phi(x)\cdot\lim_{x\to x_0}\frac{g\left(x\right)-g\left(x_0\right)}{x-x_0}=f^{\prime}\left(g\left(x_0\right)\right)\cdot g^{\prime}\left(x_0\right)\)
Example
-
\(h(x)=(3x^2+5)^3\)
\(h(x)=f(g(x))\) with \(f(x)=x^3\) and \(g(x)=3x^2+5\)
Then \(h'(x)=f'(g(x))\cdot g'(x)=3(g(x))^2\cdot (6x)=3(3x^2+5)\cdot 6(x)=18x(3x^2+5)\)