Consider the function $$f(x)=\left\{\begin{array}{cc} x^2-4 & \text{ if }x\leq 2\\4x+3&\text{ if } x\gt 2\end{array}\right.$$

This function is differentiable at $x=2$ since $\lim_{h\to 0^{\pm}}\frac{f(2+h)-f(2)}{h}=4$ (EDIT: this actually isn't true but it is true that $\lim_{x\to 2^-}f^\prime (x)=4=\lim_{x\to 2^+}f^\prime(x)$); however, it's not continuous at $x=2$.

How is that possible, doesn't differentiability at $x=a$ imply continuity at $x=a$?

This question came up when I tried to answer the question of finding $a$ and $b$ such that the function $$f(x)=\left\{\begin{array}{cc} ax^2-b & \text{ if }x\leq 2\\bx+3&\text{ if } x\gt 2\end{array}\right.$$

The solution is achieved by finding conditions on $a$ and $b$ such that it's continuous, and also such that the left/right derivates exist. The left/right derivative question gives $4a=b$. With the condition of continuity you get the additional condition that $4a-b=2b+3$, giving a unique solution. But doesn't differentiability imply continuity? What's wrong with just solving $4a=b$ like in the first example above?

  • $\begingroup$ It is more so that differentiability requires continuity rather than implies it. $\endgroup$ Oct 26 '20 at 20:15
  • $\begingroup$ If I can't assume that $\lim_{x\to 2}f^\prime(x)=\lim_{x\to 2}\frac{f(x)-f(2)}{x-2}$, then how do I solve my second question? The solution uses that $\lim_{x\to 2^-}f(x)=\lim_{x\to 2^+}f(x)$ and that $\lim_{x\to2^-}f^\prime(x)=\lim_{x\to2^+}f^\prime(x)$...how does that work? Why can we get away without using the difference quotient? $\endgroup$
    – user162520
    Oct 26 '20 at 20:25
  • $\begingroup$ It is simply the premise of the problem. Since you don't know whether or not the function is continuous at $x=2$, before you find differentiability at $x=2$, you must first account for its continuity. Compare this to a problem that begins with something like Let $F:\Bbb R\to\Bbb R$ be a differentiable function such that... (in which case you can assume $F$ to be continuous). $\endgroup$ Oct 26 '20 at 20:31
  • $\begingroup$ Your limit computation at $2^+$ is wrong. It is not $4$. $\endgroup$
    – user65203
    Oct 26 '20 at 20:33
  • 1
    $\begingroup$ @user162520 I am editing my answer. But I would like you to calculate the RHD. You will see that the RHD exists iff $4a=3b+3$. $\endgroup$ Oct 26 '20 at 22:21

Note that $f(2)=0$ and that therefore$$\lim_{x\to2^+}\frac{f(x)-f(2)}{x-2}=\lim_{x\to2^+}\frac{4x+3}{x-2}=\infty.$$So, $f$ is not differentiable at $2$.


The function is not differentiable at $2$ because $RHD$ is $$\lim_{h\to0^+}\frac{f(2+h)-f(2)}h=\lim_{h\to0^+}\frac{[4(2+h)+3]-0}h\to\infty$$Note that it is only the LHD which is $4$.

It is given that the function is differentiable at $2$. $$\begin{align*}LHD&=\lim_{h\to0^+}\frac{f(2)-f(2-h)}h=\lim_{h\to0}\frac{4a-b-[a(2-h)^2-b]}h=4a\\RHD&=\lim_{h\to0^+}\frac{f(2+h)-f(2)}h=\lim_{h\to0^+}\frac{2b+hb+3-[4a-b]}h\end{align*}$$

Note that for the $RHD$ to exist, the limit must have the $0/0$ form since the denominator tends to $0$. The numerator will tend to $0$ iff $2b+3-[4a-b]=3b+3-4a=0$, giving you the $RHD=b$.

Equating the $RHD$ and $LHD$ gives $4a=b$ and existence of $RHD$ requires $4a=3b+3$ which is also the condition which we obtained from analyzing the continuity of $f$. Thus there is no need to consider continuity separately.

  • $\begingroup$ Why can't I just say that $\lim_{x\to 2^-}f^\prime(x)=4$ and also $\lim_{x\to 2^+}f^\prime(x)=4$ $\endgroup$
    – user162520
    Oct 26 '20 at 20:08
  • 2
    $\begingroup$ That is true, but note that $RHD=\lim_{x\to2^+}\frac{f(x)-f(2)}{x-2}\ne\lim_{x\to2^+}f'(x)$ in general. In fact $f'(x)$ does not exist at $x=2$ even though the limits as you observed exist. $\endgroup$ Oct 26 '20 at 20:09
  • $\begingroup$ that blows my mind! Why doesn't $\lim_{x\to2^+}f^\prime(x)=\lim_{x\to2^+}\frac{f(x)-f(2)}{x-2}$ $\endgroup$
    – user162520
    Oct 26 '20 at 20:11
  • $\begingroup$ The LHS in your expression gives the limit of the derivative from the right of $2$ and assuming differentiability, the RHS gives the value of the derivative at $2$. For discontinuous $f'$, they may not agree. The same happens with $y=|x|$. The function is not differentiable at $0$ but the RHL of $f'(x)$ is $1$. $\endgroup$ Oct 26 '20 at 20:14
  • 1
    $\begingroup$ The LHL of $f^\prime(x)$ is $4a$ because $b$ is a constant. $\endgroup$
    – user162520
    Oct 27 '20 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.