Take the 2-minute tour ×
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.

Construct a function which is continuous in $[1,5]$ but not differentiable at $2, 3, 4$.

This question is just after the definition of differentiation and the theorem that if $f$ is finitely derivable at $c$, then $f$ is also continuous at $c$. Please help, my textbook does not have the answer.

share|improve this question
Intuitively, a function is differentiable at a point if the graph of the function at that point is "smooth". –  JavaMan Oct 20 '11 at 17:54
Just make some kind of saw-tooth with peeks in 2, 3, 4. –  Jonas Teuwen Oct 20 '11 at 17:55
Intuitively, a function is continuous if you can "walk" on the graph and it is differentiable if you can see where you came from and where you are going. –  AD. Oct 25 '11 at 18:05
@AD. Intuitively, a real-valued function of one real variable is differentiable if you can "walk" on its graph without stopping. –  Amitesh Datta Oct 26 '11 at 8:59

3 Answers 3

up vote 105 down vote accepted

$|x|$ is continuous, and differentiable everywhere except at 0. Can you see why?

From this we can build up the functions you need: $|x-2| + |x-3| + |x-4|$ is continuous (why?) and differentiable everywhere except at 2, 3, and 4.

share|improve this answer
$\uparrow$ Change first + sign to a - sign for the infamous $\mathsf{W}$ solution...:) –  Qmechanic Oct 22 at 13:36

$$\ \ \ \ \mathsf{W}\ \ \ \ $$

share|improve this answer
OK, I confess: I always dreamt of reading/posting an answer with only one character... so I could not resist the occasion. –  Did Oct 20 '11 at 19:48
+1 for succinctness. –  aardvarkk Oct 20 '11 at 19:50
Best answer ever! –  J. M. Oct 20 '11 at 22:36
This answer finally made me sign up to math.se (so that I could upvote). –  Heinzi Oct 21 '11 at 8:37
-1 "This answer is not useful" to any one who would actually ask this question. –  Graphth Oct 24 '11 at 3:12

How about $f(x) = \max(\sin(n\pi x),0)$ or perhaps $g(x) = |\sin(n\pi x)|$?

share|improve this answer
You're right, I think, because we're considering only one-sided derivatives at $1$ and $5$. –  Saaqib Mahmuud Aug 16 '13 at 9:45

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.