# Differentiable at $x=a$ implies continuous at $x=a$

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?

• It is more so that differentiability requires continuity rather than implies it. Oct 26 '20 at 20:15
• 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? Oct 26 '20 at 20:25
• 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). Oct 26 '20 at 20:31
• Your limit computation at $2^+$ is wrong. It is not $4$.
– user65203
Oct 26 '20 at 20:33
• @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$. 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.

• 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$ Oct 26 '20 at 20:08
• 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. Oct 26 '20 at 20:09
• that blows my mind! Why doesn't $\lim_{x\to2^+}f^\prime(x)=\lim_{x\to2^+}\frac{f(x)-f(2)}{x-2}$ Oct 26 '20 at 20:11
• 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$. Oct 26 '20 at 20:14
• The LHL of $f^\prime(x)$ is $4a$ because $b$ is a constant. Oct 27 '20 at 12:52