4.1 Differentiability and Continuity
Let \(S\) be a subset of \(\mathbb {R}\) and \(f:\, S\longrightarrow \mathbb {R}\) be a real valued function. If \(x_0 \in S\) is a point of \(S\), consider the difference quotient function associated with \(f\) \[g(x) = \dfrac {f(x) - f(x_0)}{x - x_0}\]
- (a).
- If \(x_0\) is an interior point of \(S\), we say that \(f\) is differentiable at \(x_0\) if \[\lim _{x\rightarrow x_0} g(x) = \lim _{x\rightarrow x_0} \dfrac {f(x) - f(x_0)}{x - x_0}\] exists and is finite
- (b).
- If \(x_0\) is the left endpoint of \(S\). We say that \(f\) is differentiable at \(x_0\) if the right limit of \(g\) exists. That is, if \[\lim _{x\rightarrow x_0^+} g(x) = \lim _{x\rightarrow x_0^+} \dfrac {f(x) - f(x_0)}{x - x_0}\hspace {0.5cm}\text {exists}\]
- (c).
- If \(x_0\) is the right end of \(S\), we say that \(f\) differentiable at \(x_0\) if \(g\) has a left limit. That is if
\[\lim _{x\rightarrow x_0^-}g(x) = \lim _{x\rightarrow x_0^-}\, \dfrac {f(x) - f(x_0)}{x - x_0}\hspace {0.5cm}\text {exists}\]
If \(f\) is differentiable at \(x_0\), the value of this finite limit is then called the derivative of \(f\) at \(x_0\) and is denoted by \(f'(x_0)\). That is \begin {align*} f'(x_0) & = \lim _{x\rightarrow x_0} \, \dfrac {f(x) - f(x_0)}{x - x_0}\\\\ f'(x_0) & = \lim _{h\rightarrow 0}\, \dfrac {f(x_0 + h) - f(x_0)}{h}\\\\ \end {align*}
Definition 4.1.1. Let \(S\) be a subset of \(\mathbb {R}\) and \(f:\, S\longrightarrow \mathbb {R}\) be a real valued function. We say that \(f\) is
differentiable on \(S\) if \(f\) is differentiable at all points of \(S\).
Suppose now that \(f\) is differentiable at \(x_0\in \mathbb {R}\). Then \(\, \displaystyle {\lim _{x\rightarrow x_0}\, \frac {f(x) - f(x_0)}{x - x_0} = f'(x_0)}.\hspace {0.3cm}\) Hence \begin {align*} \lim _{x\rightarrow x_0}\big [f(x) - f(x_0)\big ] & = \lim _{x\rightarrow x_0}\Bigg [\Big \{\dfrac {f(x) - f(x_0)}{x - x_0}\Big \}\,\cdot \,(x-x_0)\Bigg ]\\\\ & = \lim _{x\rightarrow x_0}\, \dfrac {f(x) - f(x_0)}{x - x_0}\, \cdot \, \lim _{x\rightarrow x_0}\,(x - x_0)\\\\ & = f'(x_0)\, \lim _{x\rightarrow x_0}\, (x - x_0)\\\\ & = f'(x_0)\, \cdot \, 0\\ & = 0 \end {align*}
Thus if \(f\) is differentiable at \(x_0\) then \(\hspace {0.3cm} \displaystyle {\lim _{x\rightarrow x_0}\, f(x) = f'(x_0)}\)
This shows that if \(f\) is differentiable at \(x_0\), then \(f\) is continuous at \(x_0\). That is, differentiability implies
continuity. We have proved the following.
Theorem 4.1.2. Let \(S\) be a subset of \(\mathbb {R}\) and let \(f:\, S\longrightarrow \mathbb {R}\) be real valued function. If \(x_0\in S\) such that \(f\) is
differentiable at \(x_0\), then \(f\) is continuous at \(x_0\).
The converse of this theorem is however not true. There are functions which are continuous but
not differentiable.
Proof. Suppose \(f\) is continuous at \(x_0\) and let \((x_n)\) be any sequence in \(S\) with \(x_n\rightarrow x_0\). Given \(\varepsilon >0\), continuity provides \(\delta >0\) with \(\left |f(x)-f(x_0)\right |<\varepsilon \) whenever \(\left |x-x_0\right |<\delta \); convergence provides \(N\) with \(\left |x_n-x_0\right |<\delta \) for \(n\geq N\). Combining, \(\left |f(x_n)-f(x_0)\right |<\varepsilon \) for \(n\geq N\), so \(f(x_n)\rightarrow f(x_0)\).
Conversely, suppose \(f\) is not continuous at \(x_0\). Then some \(\varepsilon _0>0\) admits no \(\delta \), so for each \(n\) there is \(x_n\in S\) with \(\left |x_n-x_0\right |<\tfrac 1n\) but \(\left |f(x_n)-f(x_0)\right |\geq \varepsilon _0\). That sequence converges to \(x_0\) while its image does not converge to \(f(x_0)\). □
Note. The contrapositive is what makes this useful in practice: to show a function is not continuous, exhibit one sequence whose image misbehaves. Proving discontinuity directly from the epsilon-delta definition requires a statement about all \(\delta \), which is harder to write and easier to get wrong.
Example 4.1.3. Let \(f:\, \mathbb {R} \longrightarrow \mathbb {R}\,\) be defined by \(f(x) = \begin {vmatrix} x\\ \end {vmatrix}\). Then
- (i).
- \(f(0) = 0\)
- (ii).
- \(\displaystyle {\lim _{x\rightarrow 0^-} f(x) = \lim _{x\rightarrow 0} (-x) = 0}\)
- (iii).
- \(\displaystyle {\lim _{x\rightarrow 0^+}f(x) = \lim _{x\rightarrow x_0} x = 0}\)
Thus \(\hspace {0.3cm} \displaystyle {\lim _{x\rightarrow 0} f(x) = 0 = f(0)}\)
So that \(f\) is continuous at the origin. However, to see that \(f\) is not differentiable at the origin, note that if \(\, x> 0\) then \(\hspace {0.3cm}\dfrac {f(x) - f(0)}{x - 0} = \dfrac {x - 0}{x - 0}= 1\hspace {0.3cm}\) so that
- (A).
- \(\displaystyle {\lim _{x\rightarrow 0^+}\dfrac {f(x) - f(0)}{x - 0} = \lim _{x\rightarrow 0^+} = 1}\)
On the other hand, if \(x < 0 \) then \(\hspace {0.3cm} \dfrac {(f(x) - f(0)}{x - 0} = \dfrac {-x - 0}{x - 0} = \dfrac {-x}{x} = -1\hspace {0.3cm}\) so that
- (B).
- \(\, \displaystyle {\lim _{x\rightarrow 0^-}\, \dfrac {f(x) - f(0)}{x - 0} = \lim _{x\rightarrow 0^-} (-1)= -1}\)
But 0 is an interior point of \(\mathbb {R}\) and
\[\lim _{x\rightarrow 0^+} \dfrac {f(x) - f(0)}{x - 0} = 1 \neq -1 \neq = \lim _{x\rightarrow 0^-}\dfrac {f(x) - f(0)}{x - 0}\]
Since the difference quotient function \(g(x) = \dfrac {f(x) - f(0)}{x - 0}\,\) does not tend to any limit as \(x\longrightarrow 0\) the function \(f\) is not differentiable
at the origin.
Theorem 4.1.4. Let \(S\) be a subset of \(\mathbb {R},\, f:\, S\longrightarrow \mathbb {R}\) and \(\mathbb {R},\, g:\, S\longrightarrow \mathbb {R}\) be real valued functions. Let \(c\in S\) be an interior point of \(S\). If \(f\) and \(g\) are differentiable at \(c\), then
- (a).
- \(\, f+ g\) is differentiable at \(c\) and \((f + g)'(c) = f'(c) + g'(c)\)
- (b).
- if \(a\) is a real number then \(f\) is differentiable at \(c\) and \(\big (a\,f\big )'\,(c) = a\, f'(c)\).
- (c).
- \(\, fg\) is differentiable at \(c\) and \(\big (f\,g\big )'\, (c) = g(c) \, f'(c) + f(c)\, g'(c)\).
- (d).
- further, if \(g(c)\neq 0\), then \(1/g\) is differentiable at \(c\) and \(\hspace {0.3cm} \Big (\dfrac {1}{g}\Big )'\,(c) = \dfrac {- g'(c)}{g(c)^2}\)
Proof. Since \(f\) and \(g\) are differentiable at \(c\), we have \begin {align*} \lim _{x\rightarrow c} \, \dfrac {f(x) - f(c)}{x - c} & = f'(c) \hspace {0.3cm}\cdots \cdots \cdots \hspace {0.3cm} (1)\\\\ \lim _{x\rightarrow c}\, \dfrac {g(x) - g(c)}{x - c} & = g'(c) \hspace {0.3cm}\cdots \cdots \cdots \hspace {0.3cm} (2) \end {align*}
Also, since differentiability implies continuity, \(f\) and \(g\) are both continuous at \(c\), so that \begin {align*} \lim _{x\rightarrow c} f(x) & = f(c)\hspace {0.3cm}\cdots \cdots \cdots \hspace {0.3cm} (3)\\\\ \lim _{x\rightarrow c} g(x) & = g(c) \hspace {0.3cm}\cdots \cdots \cdots \hspace {0.3cm} (4) \\ \end {align*}
- (a).
- Note that \((f + g) (x) = f(x) + g(x)\) , by pointwise addition \begin {align*} \lim _{x\rightarrow c} \dfrac {(f+g)\,(x) - (f+g)\,(c)}{x - c} & = \,\lim _{x\rightarrow c}\, \dfrac {\big (f(x) + g(x)\big ) - \big (f(c) + g(c)\big )}{x - c}\\\\ & = \, \lim _{x\rightarrow c}\dfrac {f(x) - f(c)}{x - c} + \lim _{x\rightarrow c} \, \dfrac {g(x) - g(c)}{x - c}\\\\ & = \, f'(c) + g'(c)\\ \end {align*}
- (b).
- Can be done in a similar way
- (c).
- \begin {align*} \lim _{x\rightarrow c} \, \dfrac {\big (fg\big )\,(x) - \big (fg\big )\,(c)}{x - c} & = \, \lim _{x\rightarrow c}\, \frac {f(x)\, g(x) - f(c)\, g(c)}{x - c}\\\\ & = \, \lim _{x\rightarrow c}\, \frac {f(x)\, g(x) - g(x)\, f(c) + g(x)\, g(c) - f(c)\,g(c)}{x - c}\\\\ & = \, \lim _{x\rightarrow c}\, \dfrac {g(x)\,\big (f(x) - f(c)\big ) + f(c)\,\big (g(x) - g(c)\big )}{x - c}\\\\ & = \, \lim _{x\rightarrow c} \, \dfrac {g(x)\, \big (f(x) - f(c)\big )}{x - c} \, + \, \lim _{x\rightarrow c} \, \dfrac {f(c)\,\big (g(x) - g(c)\big )}{x - c}\\\\ & = \, \lim _{x\rightarrow c} \, g(x)\, \lim _{x\rightarrow c}\, \dfrac {f(x) - f(c)}{x - c} \, + \,\lim _{x\rightarrow c} f(c)\, \lim _{x\rightarrow c} \dfrac {g(x) - g(c)}{x - c}\\\\ & = \, g(c)\, f'(c) \, + \, f(c)\, g'(c)\\\\ \end {align*}
- (d).
- \begin {align*} \lim _{x\rightarrow c}\, \dfrac {\dfrac {1}{g(x)} - \dfrac {1}{g(c)}}{x - c} & = \, \lim _{x\rightarrow c}\, \dfrac {g(c) - g(x)}{g(x)\, g(c)\, (x - c)}\\\\ & = -\, \lim _{x\rightarrow c}\, \dfrac {g(x) - g(c)}{g(x)\, g(c)\, (x - c)}\\\\ & = \, \dfrac {-1}{g(c)}\, \lim _{x\rightarrow c} \, \dfrac {g(x) - g(c)}{g(x)\, (x - c)}\\\\ & = \, \dfrac {-1}{g(c)}\, \lim _{x\rightarrow c}\,\dfrac {1}{g(x)}\,\lim _{x\rightarrow c}\, \dfrac {g(x) - g(c)}{x - c}\\\\ & = \, \dfrac {-1}{g(c)}\, \cdot \,\dfrac {1}{g(c)}\,\cdot \, g'(c)\\\\ & = \, \dfrac {- g'(c)}{\big (g(c)\big )^2}\\ \end {align*}
Show that \(\Bigg (\dfrac {f}{g}\Bigg )'\,(c) = \dfrac {g(c)\, f'(c) - f(c)\, g'(c)}{\big (g(c)\big )^2}\)
There are analogues for one sided differentiability.
□
Remark. If \(f:\, S\longrightarrow \mathbb {R}\) is a real valued function defined on \(S\) and \(c\in S\) is an interior point, we shall also say
that \(f\) is differentiable at \(c\) if there is a function \(L:\, S\longrightarrow \mathbb {R}\) such that \(L\) is continuous at \(c\) and \(f(x) - f(c) = L(x)\, (x - c)\) for all \(x\in S\). This
function \(L\) satisfies the condition that \(f'(c) = L(c)\).
Theorem 4.1.5 (Chain Rule). Let \(f:\, S\longrightarrow \mathbb {R}\), where \(S\) is a neighborhood of \(c\in \mathbb {R}\). Let \(g:\, T\longrightarrow \mathbb {R}\), where \(T\) is a
neighborhood of \(f(c)\), and suppose that \(f(S)\subset T\) so that the composition \(gof:\, S\longrightarrow \mathbb {R}\) is defined. If \(f\) is differentiable at \(c\)
and \(g\) is differentiable at \(f(c)\), then \(gof\) is differentiable at \(c\) and \(\, \big (gof\big )'\, (c) = g'\, \big (f(c)\big )\, \cdot \, f'(c)\).
Proof. Write \(h = gof\). By the Remark, there exists a function \(L:\, S\longrightarrow \mathbb {R}\) continuous at \(c\), such that \((1)\hspace {0.3cm} f(x) - f(c) = L(x)\, (x - c)\) for all
\(x\in S\).
Similarly, there is function \(K:\, T\longrightarrow \mathbb {R}\) continuous at \(f(c)\) such that
\((2)\hspace {0.3cm} g(y) - g\big (f(c)\big ) = K(y)\, (y - f(c))\) for all \(y \in T\).
If \(x\in S\) then \(f(x)\in T\); putting \(y = f(x)\) in (2) gives \begin {align*} g\big (f(x)\big ) - g\big (f(c)\big ) & = K \, \big (f(x)\big )\, \big (f(x) - f(c)\big )\\ & = K\, \big (f(x)\big )\, L(x)\, (x - c)\hspace {0.5cm}\text {by (1)} \end {align*}
Thus, \(\, h(x) - h(c) = \Big [\big (Kof\big )\, L\Big ]\, (x)\, (x - c)\hspace {0.2cm}\) for all \(x\in S\). Since \(\big (Kof\big )\, L\) is continuous at \(c\) it follows that \(h\) is differentiable at \(c\) and \begin {align*} h'(c) & = \Big [\big (Kof)\, L\Big ]\, (c) = \big (Kof)\, (c)\, \cdot \, L(c)\\ & = K\, \big (f(c)\big )\, \cdot \, L(c) = g'\big (f(c)\big )\cdot \, f'(c)\\\\ \end {align*} □
Example 4.1.6. Let \(f:\, \mathbb {R}\longrightarrow \mathbb {R}\) and \(g:\, \mathbb {R}\longrightarrow \mathbb {R}\) be real valued functions defined by \[f(x) = \begin {cases} x\, \sin \dfrac {1}{x} & \text {if}\hspace {0.3cm}x\neq 0\\\\ 0 & \text {if} \hspace {0.3cm} x = 0\\ \end {cases} \hspace {2cm} g(x) = \begin {cases} x^2\, \sin \dfrac {1}{x } & \text {if}\hspace {0.3cm} x\neq 0\\\\ 0 & \text {if}\hspace {0.3cm} x = 0\\ \end {cases} \]
Determine whether \(f\) and \(g\)
- (a).
- continuous
- (b).
- differentiable
find the derivative where they exist.
Proof.
- (a).
- Clearly \(f\) is continuous at all points \(x\neq 0\). We now decide what happens at the origin. Consider
the difference \(\begin {vmatrix} f(x) - f(0)\\ \end {vmatrix}\). If \(x\neq 0\) then
\[\begin {vmatrix} f(x) - f(0)\\ \end {vmatrix} = \begin {vmatrix} x\, \sin \dfrac {1}{x} - 0\\ \end {vmatrix} = \begin {vmatrix} x\, \sin \dfrac {1}{x}\\ \end {vmatrix} \leq \begin {vmatrix} x\\ \end {vmatrix}\]
But since \(\begin {vmatrix} x\\ \end {vmatrix} \longrightarrow 0\) as \(x\longrightarrow 0\), we have \(\begin {vmatrix} f(x) - f(0)\\ \end {vmatrix}\longrightarrow 0\) as \(x\longrightarrow 0\). That is, \(f(x)\longrightarrow f(0)\) as \(x\longrightarrow 0\). Since \(f(0) = 0\), we conclude that \(f\) is also continuous at
the origin.
Now, \(g(x) = x\, f(x)\) for all \(x\in \mathbb {R}\). Since the product of continuous functions is also a continuous function, we conclude that \(g\) is also continuous at all points \(x\in \mathbb {R}\).
- (b).
- Since \(1/x\) is differentiable at all points of \(\mathbb {R} - \big \{0\big \}\) and the sine function is differentiable at all point \(x\in \mathbb {R}\),
it follows from the differentiation of composite functions that
\[\dfrac {d}{dx}\Bigg (\sin \dfrac {1}{x}\Bigg ) = \dfrac {-1}{x^2}\, \cos \dfrac {1}{x}\hspace {0.2cm},\hspace {0.3cm} x\neq 0\]
using the product rule of differentiation \(f'(x) = \sin \frac {1}{x} - \frac {1}{x}\, \cos \Big (\frac {1}{x}\Big )\hspace {0.5cm} x\neq 0\) But to determine what happens at the origin,
note that if \(x\neq 0\) then
\[\dfrac {f(x) - f(0)}{x - 0} = \dfrac {x\, \sin (1/x)}{x} = \sin (1/x)\]
But you may recall that \(\hspace {0.2cm}\displaystyle {\lim _{x\rightarrow 0}\, \sin (1/x)}\,\) does not exists. Hence
\[\lim _{x\rightarrow 0}\, \dfrac {f(x) - f(0)}{x} = \lim _{x\rightarrow 0}\, \sin \dfrac {1}{x}\]
does not exist. Therefore \(f\) is not differentiable at the origin.
As for \(g\) we have \(\, g'(x) = 2x\, \sin (1/x) - \cos (1/x)\hspace {0.2cm}\) for \(x\neq 0\). If \(x\neq 0\) then \[\dfrac {g(x) - g(0)}{x - 0} = \dfrac {x^2\, \sin (1/x)}{x} =x\, \sin (1/x)\] But we have already seen above that \(\hspace {0.2cm}\displaystyle {\lim _{x\rightarrow 0}\, x\, \sin (1/x) = 0}.\,\) Therefore \(g\) is also differentiable at the origin and \(g'(0) = 0\).
Definition 4.1.7. Let \(f\) be defined on the closed interval \(a\leq x\leq b\). Suppose, now that \(f\) is differentiable at all the points of the open interval \(a < x < b\), suppose further that the one side limits \(\displaystyle {\lim _{x\rightarrow a^+} \, \dfrac {f(x) - f(a)}{x - a} }\) and \(\displaystyle {\lim _{x\rightarrow b^-}\, \dfrac {f(x) - f(b)}{x - b}}\) both exists and are finite, then \(f\) is said to be differentiable on the closed interval \([a,b]\). At any point \(x_0\in (a,b)\) we have \(\hspace {0.3cm} f'(x_0) = \lim _{x\rightarrow x_0}\, \dfrac {f(x) - f(x_0)}{x - x_0}\) while at the endpoints, we write \begin {align*} f'(a) & = \, \lim _{x\rightarrow a^+}\, \frac {f(x) - f(a)}{x - a}\hspace {0.3cm}\text {and}\hspace {0.3cm} f'(b) = \, \lim _{x\rightarrow b^-}\, \frac {f(x) - f(b)}{x - b}\\\\ \end {align*}
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.