# Differentiability of a piecewise defined discontinuous function

Let $$f(x) = \begin{cases} x-4 & \text{if } x \lt 1; \\ x+1 & \text{if } x > 1; \\ 0 & \text{if } x = 1. \end{cases}$$

Why isn’t this function differentiable at 1? Why isn’t its derivative=1 at x=1?

Both left and right sides have their derivatives equal to $$1$$ as $$x$$ approaches $$1$$. I can see that the left hand and right hand derivatives do not agree at $$x=1$$. However, could someone explain that to me intuitively, that is, without using the definition of the derivative?

• Hint: $f(1^{-}) = -3, f(1) = 0, f(1^{+}) = 2$. $f$ is not continuous at $x=1$. Jun 28 at 18:55
• No, I mean, yeah it’s not continuous. So what? Jun 28 at 19:22
• If one is to begin from the geometric concept of the derivative, then the solution is clear, there is no tangent line. The issue is only in trying to understand it algebraically , which in that case you have to do it through the definition of limits Jun 28 at 19:30
• Ahh…no tangent line/vertical tangent line… thanks @EthakkaappamwithChai Jun 28 at 19:32

If one is to begin from the geometric concept of the derivative, then the solution is clear, there is no tangent line. The issue is only in trying to understand it algebraically , which in that case you have to do it through the definition of limits.

In the algebraic standpoint, we have that the derivative exists at a point $$a$$ if the following mentioned limits exist and equalities hold:

$$f'(a)=\lim_{h \to 0} \frac{f(a) - f(a-h)}{h} = \lim_{h \to 0} \frac{f(a+h) - f(a) }{h}$$

The beauty here is that the algebraic definition is made in such a way that it lines up with the basic conceptual intuition of the derivative we have from geometry. It fails if the tangent line doesn't actually exist!

• It's redundant to write both those limits, since they say exactly the same thing. Did you mean to write $h \to 0^+$ in both cases? Jun 28 at 21:23
• After the edit, with $h \to 0^+$ in the first limit and $h \to 0^-$ in the second limit, they still say exactly the same thing (namely the one-sided derivative from the left, $f'_-(a)$, not $f'(a)$). Jun 29 at 10:23

You could also think that differentiability implies continuity. This is an assertion of the form $$A \Rightarrow B$$, where $$A$$ and $$B$$ are propositions ("being differentiable" and "being continuous", in this case). It is not very difficult to see that this kind of statements are logically equivalent to the ones of the form $$\neg B \Rightarrow \neg A$$, where $$\neg B$$ means "not being continuous" and $$\neg A$$ means "not being differentiable". That would explain why in $$x=1$$ the function $$f(x)$$ is not differentiable, if you don't want to use strictly any definition.

• I think you misunderstood the question. I knowingly crafted the function to be discontinuous. If you notice, the derivatives of both parts of the function ,that is , to the right and the left of x=1, are the same. That’s what I was confused about, that why we can’t have derivative=1 at x=1. Jun 28 at 19:45
• Ups, okay, sorry! Hope it helped though :) Jun 28 at 19:48
• It’s definitely new, I never thought it with the contrapositive, so +1. Jun 28 at 19:50
• Welcome to the site! Good answer! Jun 28 at 19:56

Also, in addition to more literal calculus-level ways of looking at this, it is worthwhile (I think) to ask what the distributional derivative (in an intuitive sense!?!?) would be. This is relevant even in elementary solution of differential equations, and very relevant in Heaviside's signal processing, Dirac's quantum physics, Green-Maxwell classical physics, etc.

So, first, yes, the function is not classically differentiable at $$x=1$$, as in the other answers. But, the jump in the values of the function at $$x=1$$ does have an interpretation in terms of the derivative... namely, the derivative includes a scalar multiple of a Dirac delta (generalized) function at $$x=1$$, in addition to being just $$=1$$ to the left and to the right of $$x=1$$.