Lecture 7. Differentiation of Real Functions

Motivation

Differentiation

Definition (Differentiability)

Let $f:[a,b]\to \mathbb{R}$ be given and take $x_0 \in (a,b)$. Then $f$ is said to be differentiable at $x_0$ if and only if $$ \lim_{x \to x_0} \frac{f(x) - f(x_0)}{x-x_0} $$ exists, in which case it is denoted by $f'(x_0)$. In other words, $f$ is differentiable at $x_0$ if and only if there is a real number $f'(x_0)$ such that $$ \lim_{x \to x_0} \frac{|f(x) - f(x_0) - f'(x_0)(x-x_0)|}{|x-x_0|} = 0. $$ Latter condition is often rewritten as $$ f(x)-f(x_0)-f'(x_0)(x-x_0)=o\bigl(|x-x_0|\bigr)\quad\text{ as }x\to x_0\, . $$

Remark

It is useful to notice that a function $f$ is differentiable at $x_0$ if and only if it is well approximated (better than to first order) by an affine function "around $x_0$''. The linear function is then uniquely determined and given by $$ x\mapsto f(x_0)+f'(x_0)(x-x_0)\, . $$ Continuity of $f$ at a point $x_0$ can also be formulated similarly as $$ f(x)-f(x_0)=o(1)\quad \text{ as }x\to x_0\, , $$ and thus amounts to $f$ being well approximated (to better than zeroth order) by $f(x_0)$ "around $x_0$''.

Notation (Little o and Big O)

Let $g$ be a non-negative real, real-valued function and $f:\mathbb{R}\to \mathbb{R}$ be given. For $x_0\in \mathbb{R}$, it is said that $$ f=O(g)\text{ as }x\to x_0\:\Longleftrightarrow\: \exists\: C\in \mathbb{R},\:\delta>0\text{ s.t. }|f(x)|\leq C\, g(x)\text{ if } |x-x_0|\leq \delta. $$ Notice that this is the same as requiring that $\limsup_{x\to x_0}\frac{|f(x)|}{g(x)}<\infty$. Analogously it is said that $$ f=o(g)\text{ as }x\to x_0\:\Longleftrightarrow\:\lim_{x\to x_0}\frac{f(x)}{g(x)}=0. $$

Intuition

Exercise

Find examples of concrete functions $f$ and $g$ which are and are not little o or big O of each other.

Proposition

If $f$ is differentiable at $x_0$, then $f$ is continuous at $x_0$.

Exercise

Give a proof of this simple observation.

Proposition (Elementary Properties)

Let $f$ and $g$ be differentiable at $x$, i.e. let $f'(x)$ and $g'(x)$ exist. Then
(i) (Linearity) $(f \pm g)'(x) = f'(x) \pm g'(x)$.
(ii) (Product rule) $(fg)'(x) = f'(x)g(x) + f(x) g'(x)$.
(iii) (Quotient rule) $\big(\frac{f} {g}\big)'(x)= \frac{f'(x)g(x) - g'(x)f(x)}{g^2(x)}$.
(iv) (Chain Rule) $(f \circ g)'(x) = f'\bigl(g(x)\bigr)g'(x)$.

Example

Let $$ f(x) =\begin{cases} x\sin(1/x),&x\ne 0\, ,\\0\, ,&x=0,\end{cases} $$ and discuss the differentiability of $f$ on $\mathbb{R}$.

Discussion

Example

Define $$ g(x) =\begin{cases} x^2 \sin(1/x)\, ,&x\ne0\, ,\\ 0\, ,&x=0\, .\end{cases} $$ Then $$ g'(0)=\lim_{x\to 0} {g(x)-g(0)\over x}=\lim_{x\to 0}{x^2 \sin(1/x)-0\over x}=0 $$ and $$ g'(x) = \begin{cases}2x \sin(1/x) - \cos(1/x),&x\ne0\, ,\\0\, ,&x=0.\end{cases} $$ The derivative $g'(x)$ exists at every point $x\in \mathbb{R}$, but notice that $g'$ is not continuous at $x=0$. This shows that differentiability does not imply continuity of the derivative (as a function).

Mean value theorems

Theorem (Rolle)

If $f$ is continuous on $[a,b]$, differentiable on $(a,b)$, and satisfies $f(a) = f(b)$, then there is $x_0 \in (a,b)$ such that $f'(x_0) = 0$.

Proof

Theorem (Lagrange's Mean Value Theorem)

Let $f$ be continuous on $[a,b]$ and $f'(x)$ exist for all $x\in(a,b)$. Then, there is $x_0 \in (a,b)$ with $$ f(b) - f(a) = f'(x_0)(b-a)\quad \text{ or }\quad f'(x_0) = \frac{f(b) - f(a)}{b-a}. $$

Proof


Next we formulate the general version of the mean value theorem.

Theorem (Mean Value Theorem)

Let $f$ and $g$ be continuous on $[a,b]$ and differentiable on $(a,b)$. Then there is $x_0 \in (a,b)$ such that $$ \big[g(b) - g(a)\big]f'(x_0) = \big[f(b) -f(a)\big]g'(x_0)\, . $$

Proof

Corollary

If $f$ is differentiable on $(a,b)$, then
(i) If $f'(x) \ge 0$ on $(a,b)$, then $f(x)$ is non-decreasing on $(a,b)$.
(ii) If $f'(x) \le 0$ on $(a,b)$, then $f(x)$ is non-increasing on $(a,b)$.
(iii) If $f'(x) = 0$ on $(a,b)$, then $f(x)$ is constant on $(a,b)$.

Remark

If $f$ is continuous on $[a,b]$, then, given any $y$ between $f(a)$ and $f(b)$, $x \in (a,b)$ can be found with $f(x)=y$ by the intermediate value theorem.

Notice that an intermediate theorem for $f'$ holds even without assuming that $f'$ is continuous. Indeed

Theorem (Intermediate Value Theorem for $f'$)

Let $f$ be differentiable on $[a,b]$ and assume that $f'(a) < f'(b)$. Then, for any $m\in[f'(a),f'(b)]$, there is $x\in (a,b)$ such that $f'(x) =m$.

Proof

Theorem (L'Hôpital)

Let $f$ and $g$ be differentiable in $(a,b)\ni x_0$ and $g'(x_0)\ne 0$. If $ \lim_{x \to x_0} f(x) = \lim_{x \to x_0}g(x) = 0, $ then $$ \lim_{x \to x_0} \frac{f(x)}{g(x)} =\frac{f'(x_0)}{g'(x_0)}. $$

Proof

Example

One has that $\lim_{x \to 0+} x \log \frac{1}{x}=0$ since $$ \lim_{x\to 0+}x \log \frac{1}{x}=\lim_{y\to\infty}\frac{\log y}{y}= \lim_{y\to\infty}\frac{1}{y}=0. $$

Question

Why is the above not a correct example of a direct application of L'Hôpital's rule? How can you fix it?

Theorem (Taylor's Expansion)

Let $f$ be differentiable up to order $(n+1)$ on $[a,b]$. Then there is $\xi\in(a,b)$ such that $$ f(b) = \sum_{j=0}^n \frac{f^{(j)}(a)}{j!} (b-a)^j+ \frac{f^{n+1}(\xi)}{(n+1)!}(b-a)^{n+1} \, . $$

Proof

Definition (Real Analyticity)

We say that that a function $f$ is analytic at $x_0$ if and only if $$ f(x)=\sum_{j=0}^\infty \frac{f^{(j)}(x_0)}{j!} (x-x_0)^j,\ \hbox{ for } \ |x-x_0|<\delta $$ and some $\delta>0$. If $f$ is analytic at every point in $[a,b]$, we say that $f$ is real analytic in $[a, b]$.

Notation

The space of analytic functions on $[a,b]$ is denoted by $\operatorname{C}^\omega\bigl([a,b]\bigr)$. Furthermore it will be useful to have $$ \operatorname{C} ^k(a,b):=\big\{ f:(a,b)\to \mathbb{R}\, :\, f,f',\dots,f^{(k)} \in\operatorname{C}(a,b)\big\} $$ and $$ \operatorname{C}^{\infty}(a,b):=\big\{ f\in \operatorname{C}(a,b)\, :\, f^{(k)}\in\operatorname{C}(a,b)\, ,\: k=0,1,2,\dots\big\}. $$

Example

Find a function $f \in C^{\infty}(-\infty,\infty)$ which is not real analytic at $x=0$.

Discussion

Example

Suppose $f$ is defined on $(x_0-\delta, x_0 +\delta)$ and that $f''(x_0)$ exists for some $x_0$ and $\delta>0$. Show that $$ \lim_{h \to 0} \frac{ f(x_0+h) + f(x_0-h) -2 f(x_0) }{h^2} = f''(x_0). $$

Solution

Convex Functions

Theorem (Characterization of Convex Function)

(i) Let $f[a,b]\to \mathbb{R}$ possesss a second order derivative everywhere. Then $$ f\text{ is convex on }[a,b] \iff f''(x) \ge 0\, ,\: x\in [a,b]. $$ (ii) Let $f[a,b]\to \mathbb{R}$ possess a first order derivative everywhere on $(a,b)$. Then $$ f\text{ is convex on }(a, b) \iff f(x)\ge f(x_0)+f'(x_0)(x-x_0)\, ,\: x_0, x\in (a, b) . $$

Proof

Example

Let $f$ be continuous on $(0, \infty)$ and $f'$ exist on $(0, \infty)$. Assume that $f'$ is monotone increasing and $f(0) = 0$. Show that $$ g(x):= \frac{f(x)}{x}\, ,\: x\in(0,\infty), $$ is increasing.

Proof

Example

Let $f,\, f', \, f'':[0,\infty)\to \mathbb{R}$ be bounded and let $$ \| f\| _\infty= \sup\{ | f(x)|: x\in [0, \infty)\}\, . $$ Then $$ \| f'\| _\infty ^2\leq 4 \| f\|_\infty \| f''\|_\infty\, , $$ and the inequality is sharp.

Proof