Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started to learn little about the definition of derivative, and I come across the following function. What is the derivative of the following function $$ f(x) = \begin{cases} x-a,\ \ \text{if}\ x\geq a\\ x,\ \ \ \ \ \ \ \ \ \text{if}\ x<a \end{cases}. $$ The function is obviously not continuous (at $x=a$) and hence I believe that the derivative is $1$ for any $x\neq a$ and not defined at $x=a$. If I'm right, how can I modify the function such that it's derivative will be defined at $x=a$?

Thank you.

share|cite|improve this question
You're correct that the derivative is not defined at $a$ (if $a\neq 0$). But you need to take a look again at what the derivative is when it is defined; are you sure that the derivative of the function $f(x)=x$ can be made to be any real number $a$ that you choose? – Zev Chonoles Feb 25 '13 at 6:55
The derivative is not $a$; is that a typo? In order to be differentiable, first it must be continuous. What values of $a$ make the function continuous at $a$? You can take left-hand and right-hand limits to find out. – Jonas Meyer Feb 25 '13 at 6:57
Yes, it is a typo (fixed). Thank you! – user63875 Feb 25 '13 at 7:00

It is not possible to make this function differentiable at $a$ by modifying it only at $a$. Because the left- and right- limits do not agree, the function will not be continuous at $a$, no matter what you assign as its value at $a$. And not being continuous, it can't be differentiable.

But you can make the function differentiable everywhere by modifying it in a small neighborhood of $a$ - as small as you wish. In a picture, it looks like this: from


you get


The method I used here is called mollification. To be precise, the second function is defined as

$$g(x)=\int_{-0.1}^{0.1} f(x-t) \,(10-100|t|)\,dt$$

which isn't the best mollification possible but is simple to write, and good enough to make the function once differentiable.

share|cite|improve this answer
+1 for the graph. – Shuhao Cao Jul 16 '13 at 4:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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