Skip to main content
Mathematics LibreTexts

2.15: (Optional) — Is \(\lim_{x\to c}f'(x)\) Equal to \(f'(c)\text{?}\)

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Consider the function

    \[ f(x) = \begin{cases} \frac{\sin x^2}{x} &\text{if }x\ne 0 \\ 0 &\text{if }x=0 \end{cases} \nonumber \]

    For any \(x\ne 0\) we can easily use our differentiation rules to find

    \[ f'(x) = \frac{2x^2\cos x^2 -\sin x^2}{x^2} \nonumber \]

    But for \(x=0\) none of our usual differentation rules apply. So how do we find \(f'(0)\text{?}\) One obviously legitimate strategy is to directly apply the Definition 2.2.1 of the derivative. As an alternative, we will now consider the question “Can one find \(f'(0)\) by taking the limit of \(f'(x)\) as \(x\) tends to zero?”. There is bad news and there is good news.

    • The bad news is that, even for functions \(f(x)\) that are differentiable for all \(x\text{,}\) \(f'(x)\) need not be continuous. That is, it is not always true that \(\lim_{x\rightarrow 0}f'(x) = f'(0)\text{.}\) We will see a function for which \(\lim_{x\rightarrow 0}f'(x) \ne f'(0)\) in Example 2.15.1, below.
    • The good news is that Theorem 2.15.2, below provides conditions which are sufficient to guarantee that \(f(x)\) is differentiable at \(x=0\) and that \(\lim_{x\rightarrow 0}f'(x) = f'(0)\text{.}\)
    Example 2.15.1

    Consider the function

    \[ f(x) = \begin{cases} x^2\sin\frac{1}{x} &\text{if }x\ne 0 \\ 0 &\text{if }x=0 \end{cases} \nonumber \]

    For \(x\ne 0\) we have, by the product and chain rules,

    \begin{align*} f'(x) &= 2x\, \sin\frac{1}{x} + x^2 \left(\cos\frac{1}{x}\right) \left(-\frac{1}{x^2}\right) \\ &= 2x\, \sin\frac{1}{x} - \cos\frac{1}{x} \end{align*}

    As \(\left|\sin\frac{1}{x}\right|\le 1\text{,}\) we have

    \[ \lim_{x\rightarrow 0}2x\, \sin\frac{1}{x}=0 \nonumber \]

    On the other hand, as \(x\) tends to zero, \(\frac{1}{x}\) goes to \(\pm\infty\text{.}\) So

    \[ \lim_{x\rightarrow 0}\cos\frac{1}{x} = DNE \implies \lim_{x\rightarrow 0}f'(x) = DNE \nonumber \]

    We will now see that, despite this, \(f'(0)\) is perfectly well defined. By definition

    \begin{align*} f'(0) &= \lim_{h\to 0}\frac{f(h)-f(0)}{h} \\ & = \lim_{h\to 0}\frac{h^2\sin\frac{1}{h}-0}{h} \\ & = \lim_{h\to 0} h\sin\frac{1}{h} \\ & = 0\qquad\text{since }\left|\sin\frac{1}{h}\right|\le 1 \end{align*}

    So \(f'(0)\) exists, but is not equal to \(\lim_{x\rightarrow 0}f'(x)\text{,}\) which does not exist.

    Now for the good news.

    Theorem 2.15.2

    Let \(a\lt c\lt b\text{.}\) Assume that

    • the function \(f(x)\) is continous on the interval \(a\lt x\lt b\) and
    • is differentiable at every \(x\) in the intervals \(a\lt x\lt c\) and \(c\lt x\lt b\) and
    • the limit \(\lim_{x\rightarrow c}f'(x)\) exists.

    Then \(f\) is differentiable at \(x=c\) and

    \[ f'(c) = \lim_{x\rightarrow c}f'(x) \nonumber \]


    By hypothesis, there is a number \(L\) such that

    \[ \lim_{x\rightarrow c}f'(x) = L \nonumber \]

    By definition

    \[ f'(c) = \lim_{h\to 0}\frac{f(c+h)-f(c)}{h} \nonumber \]

    By the Mean Value Theorem (Theorem 2.13.5 ) there is, for each \(h\text{,}\) an (unknown) number \(x_h\) between \(c\) and \(c+h\) such that \(f'(x_h)=\frac{f(c+h)-f(c)}{h}\text{.}\) So

    \[ f'(c) = \lim_{h\to 0} f'(x_h) \nonumber \]

    As \(h\) tends to zero, \(c+h\) tends to \(c\text{,}\) and so \(x_h\) is forced to tend to \(c\text{,}\) and \(f'(x_h)\) is forced to tend to \(L\) so that

    \[ f'(c) = \lim_{h\to 0} f'(x_h) = L \nonumber \]

    In the next example we evaluate \(f'(0)\) by applying Theorem 2.15.2.

    Example 2.15.3


    \[ f(x) = \begin{cases} \frac{\sin x^2}{x} &\text{if }x\ne 0 \\ 0 &\text{if }x=0 \end{cases} \nonumber \]

    We have already observed above that, for \(x\ne 0\text{,}\)

    \[ f'(x) = \frac{2x^2\cos x^2 -\sin x^2}{x^2} = 2\cos x^2 - \frac{\sin x^2}{x^2} \nonumber \]

    We use Theorem 2.15.2 with \(c=0\) to show that \(f(x)\) is differentiable at \(x=0\) and to evaluate \(f'(0)\text{.}\) That theorem has two hypotheses that we have not yet verified, namely the continuity of \(f(x)\) at \(x=0\text{,}\) and the existence of the limit \(\lim_{x\rightarrow 0}f'(x)\text{.}\) We verify them now.

    • We already know, by Lemma 2.8.1, that \(\lim_{h\rightarrow 0}\frac{\sin h}{h}=1\text{.}\) So

      \begin{align*} \lim_{x\rightarrow 0}\frac{\sin x^2}{x^2} &=\lim_{h\rightarrow 0^+}\frac{\sin h}{h}\qquad\text{with }h=x^2\\ &=1 \end{align*}


      \begin{align*} \lim_{x\rightarrow 0} f(x) &=\lim_{x\rightarrow 0}\frac{\sin x^2}{x} =\lim_{x\rightarrow 0}x\,\frac{\sin x^2}{x^2} =\lim_{x\rightarrow 0}x\ \lim_{x\rightarrow 0}\frac{\sin x^2}{x^2} =0\times 1 =0 \end{align*}

      and \(f(x)\) is continuous at \(x=0\text{.}\)
    • The limit of the derivative is

      \begin{align*} \lim_{x\rightarrow 0}f'(x) &= \lim_{x\rightarrow 0}\left[2\cos x^2 - \frac{\sin x^2}{x^2}\right] =2\times 1 -1 = 1 \end{align*}

    So, by Theorem 2.15.2, \(f(x)\) is differentiable at \(x=0\) and \(f'(0)=1\text{.}\)

    This page titled 2.15: (Optional) — Is \(\lim_{x\to c}f'(x)\) Equal to \(f'(c)\text{?}\) is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Joel Feldman, Andrew Rechnitzer and Elyse Yeager via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.