Miscellaneous · Q20: Yes: is continuous everywhere, not differentiable only at 0 and 1
Does there exist a function which is continuous everywhere but not differentiable at exactly two points? Justify your answer.
Yes. Consider , i.e.
is continuous everywhere, being the sum of the continuous functions and .
At , :
LHD RHD, so is not differentiable at .
At , :
LHD RHD, so is not differentiable at .
On , and , is a polynomial, so it is differentiable there.
Hence is continuous everywhere but not differentiable at exactly two points, and . So such a function exists.
Want the reason behind every step, the basics and the checks?
is continuous everywhere and has exactly one corner, at 0 (shown in the book after Theorem 3). Shifting it gives , with its corner at 1. Adding the two keeps continuity and keeps both corners, because near each corner the other term is an ordinary straight line. To justify "yes" we must name a function and prove all three facts: continuous everywhere, not differentiable at the two points, differentiable everywhere else.
- Question
- Is there , continuous at every real number, that fails to be differentiable at exactly two points?
- Answer to justify
- Yes, for example .
- Plan
- (1) Write piecewise. (2) Prove is continuous everywhere, checking the junctions 0 and 1 directly. (3) Show is differentiable at every . (4) One-sided derivatives at 0. (5) One-sided derivatives at 1. (6) Conclude.
Basics you need
is continuous at if the left-hand limit, the right-hand limit and all exist and are equal (Definition 1, Section 5.2). Lesson: continuity at a point
Sums of continuous functions are continuous (Theorem 1); compositions of continuous functions are continuous (Theorem 2). is continuous (Example 7). Lesson: algebra of continuous functions
is differentiable at exactly when the left-hand and right-hand limits of are finite and equal (Section 5.3). Lesson: differentiability
Remove each absolute value by splitting the line where its inside changes sign. Basics: piecewise functions
Solution
Choose the function and write it piecewise
Let for all real . The insides and change sign at 0 and 1, so:
On each piece both absolute values have a fixed sign, so they can be replaced by ordinary expressions. At the junctions both neighbouring formulas give the same value ( and ), which already hints at continuity.is continuous at every real number
By the theorems. is continuous (Example 7). is the composite of the continuous functions and , so it is continuous (Theorem 2). Their sum is continuous (Theorem 1).
Directly at the junctions. At :
At :
All three numbers agree at each junction, and inside each piece is a polynomial, which is continuous (Example 14). So is continuous everywhere.
The theorem argument is already a complete proof; the direct check shows the same thing through the definition, at the only two places where something could go wrong.Definition 1, Section 5.2; Theorems 1 and 2, Section 5.2.1; Examples 7 and 14 (Basics 1, 2). Lesson: continuity at a pointis differentiable at every other than 0 and 1
Take . For , both and are negative, so
Hence .
In the same way for (where is the constant 1) and for (where ).
Around any point that is not a junction there is a small open interval on which is one straight line, so the difference quotient is that line's slope for all small . Only at 0 and 1 do the two sides of a point use different formulas.Derivative as the limit of the difference quotient (Basic 3). Basics: slope at a pointNot differentiable at
Here . For small , ; for small (), .
, so is not differentiable at 0.
The graph arrives at with slope and leaves with slope 0: a corner. Note that the term is the straight line near 0, so it adds the same slope on both sides and cannot cancel the corner of .Left-hand and right-hand derivatives, Section 5.3 (Basic 3). Lesson: differentiabilityNot differentiable at
Here . For small (), ; for small , .
, so is not differentiable at 1.
for , equal scales. Three straight pieces with slopes , and ; the graph is unbroken (continuous) but has corners at and , and nowhere else. Same picture as at 0: slope 0 on the left, slope 2 on the right. Near 1 the term is just , a line, so the corner of survives.Compare Exercise 5.2, Q9: is not differentiable at 1. Exercise 5.2 Q9Conclude
is continuous at every real number (Step 2), differentiable at every real number except 0 and 1 (Step 3), and not differentiable at 0 or at 1 (Steps 4, 5). So it is continuous everywhere and fails to be differentiable at exactly two points. The answer to the question is yes.
"Exactly two" needs both halves: at least these two points fail (Steps 4, 5) and no other point fails (Step 3). Many other examples work the same way, for instance for any two different numbers , .Theorem 3 and its remark: continuity does not imply differentiability. Lesson: differentiability
Yes. For example is continuous at every real number, is differentiable at every other than 0 and 1, and is not differentiable at (one-sided derivatives and ) or at (one-sided derivatives and ).
With : at 0, and . At 1, and . ✓ Values: , , .
- Answering "yes" without an example and a proof. "Justify" means: exhibit a function and prove all three properties.
- Assuming corners always survive addition. They can cancel: has no corner at all. That is why Steps 4 and 5 compute the one-sided derivatives of the sum itself.
- Forgetting to show differentiability elsewhere. Without Step 3, the example could fail at more than two points.
- Continuity does not imply differentiability; corners of are the standard examples.
- Sums of shifted absolute values give continuous functions with corners exactly where you choose.
- To prove "exactly points", show failure at those points and success everywhere else.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| Continuity at a point | Step 2 | Definition 1, Section 5.2 (Lesson: continuity at a point) |
| is continuous; polynomials are continuous | Step 2 | Examples 7 and 14, Section 5.2 |
| Sums and composites of continuous functions are continuous | Step 2 | Theorems 1 and 2, Section 5.2.1 (Lesson: algebra of continuous functions) |
| Differentiable at : one-sided derivatives finite and equal | Steps 3–5 | Section 5.3 (Lesson: differentiability) |
| Continuity does not imply differentiability ( at 0) | Steps 4–6 | Theorem 3 and the remark after Corollary 1, Section 5.3 |
| Numerical values, figure coordinates | Check, figure | Recomputed in the site's verification script |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →