SOLVER7 Study. Nothing Else.
Chapter 5 Miscellaneous Exercise Q20

Does there exist a function which is continuous everywhere but not differentiable at exactly two points? Justify your answer.

CBSE Class 12 Maths · Continuity and Differentiability

Solution

👶 Simple Explanation

Simple Explanation

Imagine drawing a smooth road on paper — no lifting your pen. That is what 'continuous' means. Now imagine the road has two sharp zigzag bends in it. At those bends, the road is still connected, but you cannot measure a clean slope there. The function \( f(x) = |x - 1| + |x - 2| \) is exactly like that road. It never breaks, so it is continuous everywhere. But at \( x = 1 \) and \( x = 2 \) there are sharp corners, so the slope cannot be defined at those two points.

Answer: Yes, such a function exists. The function \( f(x) = |x - 1| + |x - 2| \) is continuous for every real number but fails to be differentiable at exactly two points, namely \( x = 1 \) and \( x = 2 \) (sharp corners where the left and right derivatives differ).

📖 Continuous Everywhere but Non-Differentiable at Exactly Two Points

Detailed Explanation

A key theorem in Class 12 says that if a function is differentiable at a point, then it must be continuous at that point. But the converse is NOT true: a function can be continuous at a point yet fail to be differentiable there. The classic example is \( f(x) = |x| \), which is continuous everywhere but not differentiable at \( x = 0 \), because the graph has a sharp corner there. A function fails to be differentiable at a point when its graph has a corner (the left-hand derivative and right-hand derivative are unequal) even though there is no break. So YES, such a function exists. To get non-differentiability at exactly two points, we simply create two corners, for example at \( x = 1 \) and \( x = 2 \), using absolute value expressions.

Formula Used

Differentiable at \( a \Rightarrow \) continuous at \( a \), but continuous at \( a \not\Rightarrow \) differentiable at \( a \). Non-differentiability at \( a \) occurs when \( \lim_{h \to 0^-} \frac{f(a+h)-f(a)}{h} \ne \lim_{h \to 0^+} \frac{f(a+h)-f(a)}{h} \).

Solution

  1. Step 1: Answer the question: Yes, such a function exists. We will construct one and justify that it is continuous everywhere but non-differentiable at exactly two points.
  2. Step 2: Consider the function \[ f(x) = |x - 1| + |x - 2|. \] This is a sum of two absolute-value functions. Each absolute-value function creates one corner, so we expect corners at \( x = 1 \) and \( x = 2 \).
  3. Step 3: Check continuity. The modulus function \( |x| \) is continuous for every real \( x \). Hence \( |x - 1| \) and \( |x - 2| \) are continuous everywhere, and the sum of continuous functions is continuous. Therefore \( f(x) \) is continuous for all real \( x \).
  4. Step 4: Write \( f \) as a piecewise function to study differentiability: \[ f(x) = \begin{cases} (1-x)+(2-x) = 3 - 2x & x < 1 \\ (x-1)+(2-x) = 1 & 1 \le x \le 2 \\ (x-1)+(x-2) = 2x - 3 & x > 2 \end{cases} \]
  5. Step 5: Differentiate on each open interval where \( f \) is a straight line: \[ f'(x) = \begin{cases} -2 & x < 1 \\ 0 & 1 < x < 2 \\ 2 & x > 2 \end{cases} \] These are all valid, so \( f \) is differentiable everywhere except possibly at the join points \( x = 1 \) and \( x = 2 \).
  6. Step 6: Check the corner at \( x = 1 \). The left-hand derivative is \( -2 \) and the right-hand derivative is \( 0 \). Since \( -2 \ne 0 \), \( f \) is NOT differentiable at \( x = 1 \), although it is continuous there.
  7. Step 7: Check the corner at \( x = 2 \). The left-hand derivative is \( 0 \) and the right-hand derivative is \( 2 \). Since \( 0 \ne 2 \), \( f \) is NOT differentiable at \( x = 2 \), although it is continuous there.
  8. Step 8: Conclusion: \( f(x) = |x-1| + |x-2| \) is continuous for all real \( x \) and non-differentiable at exactly the two points \( x = 1 \) and \( x = 2 \). This justifies that such a function does exist.

Final Answer

Yes, such a function exists. The function \( f(x) = |x - 1| + |x - 2| \) is continuous for every real number but fails to be differentiable at exactly two points, namely \( x = 1 \) and \( x = 2 \) (sharp corners where the left and right derivatives differ).

Common Mistake

A common mistake is to think that continuity automatically implies differentiability, and hence to claim no such function can exist. In fact, differentiability implies continuity, but not the other way round; \( |x| \)-type corner functions are continuous yet not differentiable at the corner points.

🪜 Step-by-step Solution

Step-by-step Solution

  1. Step 1: Confirm that the answer is YES — such a function does exist. Reason: The question asks whether a continuous function can be non-differentiable at exactly two points. Since differentiability implies continuity but not the other way around, we can construct a function with sharp corners (which break differentiability) while keeping the graph unbroken everywhere (which preserves continuity).
  2. Step 2: Recall that \( f(x) = |x| \) is the building block: it is continuous everywhere but has a sharp corner at \( x = 0 \), making it non-differentiable there. Reason: Understanding this single-corner example helps us generalise — by shifting the corner to any desired point, we can place non-differentiability wherever we choose.
  3. Step 3: Construct the candidate function by shifting two absolute-value expressions to create corners at \( x = 1 \) and \( x = 2 \): \[ f(x) = |x - 1| + |x - 2| \] Reason: Each absolute-value term \( |x - 1| \) and \( |x - 2| \) individually creates exactly one corner, so their sum is expected to have corners at both \( x = 1 \) and \( x = 2 \).
  4. Step 4: Verify continuity everywhere. Since \( |x - 1| \) is continuous for all \( x \in \mathbb{R} \) and \( |x - 2| \) is continuous for all \( x \in \mathbb{R} \), their sum \( f(x) = |x-1| + |x-2| \) is also continuous for all \( x \in \mathbb{R} \). Reason: The modulus function has no breaks or jumps, and the sum of two continuous functions is continuous — so \( f \) has no discontinuities anywhere.
  5. Step 5: Check non-differentiability at \( x = 1 \). Compute the left-hand derivative (LHD) and right-hand derivative (RHD) at \( x = 1 \). For \( x \) slightly less than 1, we have \( |x-1| = -(x-1) \) and \( |x-2| = -(x-2) \), giving \( f(x) = -(x-1)-(x-2) = -2x+3 \), so the LHD is \( -2 \). For \( x \) slightly greater than 1 but less than 2, we have \( |x-1| = x-1 \) and \( |x-2| = -(x-2) \), giving \( f(x) = (x-1)-(x-2) = 1 \), so the RHD is \( 0 \). Since \( -2 \ne 0 \), \( f \) is not differentiable at \( x = 1 \). Reason: A sharp corner exists at \( x = 1 \) because the slope jumps abruptly from \( -2 \) on the left to \( 0 \) on the right.
  6. Step 6: Check non-differentiability at \( x = 2 \). For \( x \) slightly less than 2 but greater than 1, \( f(x) = (x-1)-(x-2) = 1 \), so the LHD is \( 0 \). For \( x \) slightly greater than 2, \( |x-1| = x-1 \) and \( |x-2| = x-2 \), giving \( f(x) = (x-1)+(x-2) = 2x-3 \), so the RHD is \( 2 \). Since \( 0 \ne 2 \), \( f \) is not differentiable at \( x = 2 \). Reason: Another sharp corner appears at \( x = 2 \) because the slope jumps from \( 0 \) to \( 2 \).
  7. Step 7: Confirm differentiability at all other points. Away from \( x = 1 \) and \( x = 2 \), the piecewise expressions for \( f \) are linear (polynomials), which are differentiable everywhere they apply. Reason: Linear functions have constant, well-defined derivatives, so no additional corners or breaks exist outside the two identified points.

Final Answer

Yes, such a function exists. The function \( f(x) = |x - 1| + |x - 2| \) is continuous for every real number but fails to be differentiable at exactly two points, namely \( x = 1 \) and \( x = 2 \) (sharp corners where the left and right derivatives differ).

Common Mistake

One common mistake: students assume that if a function is continuous at a point it must also be differentiable there — this is false. Continuity means no break in the graph, but differentiability additionally requires no sharp corner; the two conditions are not equivalent.

✍️ Exam-ready Answer

Exam-ready Answer

  1. Step 1: Claim: Yes. Consider \[f(x) = |x - 1| + |x - 2|.\]
  2. Step 2: Continuity: Each \( |x - c| \) is continuous everywhere, so \( f \) is continuous on \( \mathbb{R} \).
  3. Step 3: Non-differentiability at \( x = 1 \): Left-hand derivative \( = \lim_{h \to 0^-} \frac{f(1+h)-f(1)}{h} = -2 \), right-hand derivative \( = \lim_{h \to 0^+} \frac{f(1+h)-f(1)}{h} = 0 \). Since \( -2 \ne 0 \), \( f \) is not differentiable at \( x = 1 \).
  4. Step 4: Non-differentiability at \( x = 2 \): Left-hand derivative \( = 0 \), right-hand derivative \( = 2 \). Since \( 0 \ne 2 \), \( f \) is not differentiable at \( x = 2 \).

Answer: Yes, such a function exists. The function \( f(x) = |x - 1| + |x - 2| \) is continuous for every real number but fails to be differentiable at exactly two points, namely \( x = 1 \) and \( x = 2 \) (sharp corners where the left and right derivatives differ).

➕ More Examples

More Examples

Example 1

Question: Does there exist a function which is continuous everywhere but not differentiable at exactly three points? Justify your answer by constructing such a function and verifying your claim.

Solution: Yes, such a function exists. Consider the function \[f(x) = |x - 1| + |x - 3| + |x - 5|\] Step 1: Continuity. Each term \( |x - 1| \), \( |x - 3| \), and \( |x - 5| \) is an absolute-value function, and every absolute-value function is continuous everywhere on \( \mathbb{R} \). Since \( f \) is a sum of three continuous functions, \( f \) is continuous everywhere on \( \mathbb{R} \). Step 2: Differentiability at the critical points. For a general absolute-value term \( |x - c| \), the derivative is \( +1 \) when \( x > c \) and \( -1 \) when \( x < c \), so the left-hand and right-hand derivatives differ at \( x = c \). At \( x = 1 \): Left-hand derivative of \( f \): \[f'(1^-) = (-1) + (-1) + (-1) = -3\] Right-hand derivative of \( f \): \[f'(1^+) = (+1) + (-1) + (-1) = -1\] Since \( f'(1^-) \ne f'(1^+) \), \( f \) is not differentiable at \( x = 1 \). At \( x = 3 \): Left-hand derivative: \[f'(3^-) = (+1) + (-1) + (-1) = -1\] Right-hand derivative: \[f'(3^+) = (+1) + (+1) + (-1) = +1\] Since \( f'(3^-) \ne f'(3^+) \), \( f \) is not differentiable at \( x = 3 \). At \( x = 5 \): Left-hand derivative: \[f'(5^-) = (+1) + (+1) + (-1) = +1\] Right-hand derivative: \[f'(5^+) = (+1) + (+1) + (+1) = +3\] Since \( f'(5^-) \ne f'(5^+) \), \( f \) is not differentiable at \( x = 5 \). Step 3: Differentiability everywhere else. For all \( x \notin \{1, 3, 5\} \), each absolute-value term is differentiable (it equals either \( x - c \) or \( -(x-c) \) in a neighbourhood of \( x \)), so \( f \) is differentiable at every such point. Conclusion: \( f(x) = |x - 1| + |x - 3| + |x - 5| \) is continuous everywhere on \( \mathbb{R} \) but is not differentiable at exactly the three points \( x = 1,\ 3,\ 5 \).

Answer: Yes. The function \( f(x) = |x - 1| + |x - 3| + |x - 5| \) is continuous everywhere but not differentiable at exactly three points: \( x = 1,\ 3,\ 5 \).

Example 2

Question: Construct a function that is continuous on all of \( \mathbb{R} \) but is not differentiable at exactly the two points \( x = -2 \) and \( x = 4 \). Verify both continuity and non-differentiability at those points.

Solution: Yes, such a function can be constructed. Define \[g(x) = |x + 2| + |x - 4|\] Step 1: Verify continuity. The function \( |x + 2| \) is continuous everywhere, and \( |x - 4| \) is continuous everywhere. Their sum \( g(x) \) is therefore continuous everywhere on \( \mathbb{R} \). Step 2: Check differentiability at \( x = -2 \). For \( |x + 2| \): the left-hand derivative at \( x = -2 \) is \( -1 \) and the right-hand derivative is \( +1 \). For \( |x - 4| \): since \( -2 < 4 \), the function equals \( 4 - x \) near \( x = -2 \), so its derivative is \( -1 \) on both sides at \( x = -2 \). Left-hand derivative of \( g \) at \( x = -2 \): \[g'(-2^-) = (-1) + (-1) = -2\] Right-hand derivative of \( g \) at \( x = -2 \): \[g'(-2^+) = (+1) + (-1) = 0\] Since \( g'(-2^-) \ne g'(-2^+) \), the function \( g \) is not differentiable at \( x = -2 \). Step 3: Check differentiability at \( x = 4 \). For \( |x + 2| \): since \( 4 > -2 \), the function equals \( x + 2 \) near \( x = 4 \), so its derivative is \( +1 \) on both sides at \( x = 4 \). For \( |x - 4| \): the left-hand derivative at \( x = 4 \) is \( -1 \) and the right-hand derivative is \( +1 \). Left-hand derivative of \( g \) at \( x = 4 \): \[g'(4^-) = (+1) + (-1) = 0\] Right-hand derivative of \( g \) at \( x = 4 \): \[g'(4^+) = (+1) + (+1) = 2\] Since \( g'(4^-) \ne g'(4^+) \), the function \( g \) is not differentiable at \( x = 4 \). Step 4: Differentiability everywhere else. For \( x < -2 \): \( g(x) = -(x+2) + (4-x) = -2x + 2 \), which is differentiable. For \( -2 < x < 4 \): \( g(x) = (x+2) + (4-x) = 6 \), which is differentiable (derivative \( = 0 \)). For \( x > 4 \): \( g(x) = (x+2) + (x-4) = 2x - 2 \), which is differentiable. Conclusion: \( g(x) = |x + 2| + |x - 4| \) is continuous everywhere on \( \mathbb{R} \) and is not differentiable at exactly the two points \( x = -2 \) and \( x = 4 \).

Answer: Yes. The function \( g(x) = |x + 2| + |x - 4| \) is continuous everywhere but not differentiable at exactly the two points \( x = -2 \) and \( x = 4 \).

🎯 Try a Similar Question

Try a Similar Question

Question: Does there exist a function which is continuous everywhere but not differentiable at exactly three points? Justify your answer with an explicit example and verify the claims made.

Solution

  1. Step 1 — Construct a candidate function: Consider the function \( f(x) = |x| + |x - 1| + |x - 3| \) defined for all \( x \in \mathbb{R} \). We claim this function is continuous everywhere but fails to be differentiable at exactly the three points \( x = 0 \), \( x = 1 \), and \( x = 3 \).
  2. Step 2 — Verify continuity everywhere: Each of \( |x| \), \( |x - 1| \), and \( |x - 3| \) is a composition of continuous functions (a linear function composed with the absolute value), hence continuous for all \( x \in \mathbb{R} \). A finite sum of continuous functions is continuous, so \( f(x) = |x| + |x - 1| + |x - 3| \) is continuous on all of \( \mathbb{R} \).
  3. Step 3 — Express f(x) as a piecewise linear function: We break \( \mathbb{R} \) into four intervals using the critical points 0, 1, and 3. For \( x < 0 \): \( f(x) = (-x) + (-(x-1)) + (-(x-3)) = -3x + 4 \). For \( 0 \le x < 1 \): \( f(x) = x + (-(x-1)) + (-(x-3)) = -x + 4 \). For \( 1 \le x < 3 \): \( f(x) = x + (x-1) + (-(x-3)) = x + 2 \). For \( x \ge 3 \): \( f(x) = x + (x-1) + (x-3) = 3x - 4 \).
  4. Step 4 — Check differentiability at x = 0: Left-hand derivative at \( x = 0 \): the slope of \( -3x + 4 \) is \( -3 \). Right-hand derivative at \( x = 0 \): the slope of \( -x + 4 \) is \( -1 \). Since \( -3 \ne -1 \), the function is NOT differentiable at \( x = 0 \).
  5. Step 5 — Check differentiability at x = 1: Left-hand derivative at \( x = 1 \): the slope of \( -x + 4 \) is \( -1 \). Right-hand derivative at \( x = 1 \): the slope of \( x + 2 \) is \( 1 \). Since \( -1 \ne 1 \), the function is NOT differentiable at \( x = 1 \).
  6. Step 6 — Check differentiability at x = 3: Left-hand derivative at \( x = 3 \): the slope of \( x + 2 \) is \( 1 \). Right-hand derivative at \( x = 3 \): the slope of \( 3x - 4 \) is \( 3 \). Since \( 1 \ne 3 \), the function is NOT differentiable at \( x = 3 \).
  7. Step 7 — Confirm differentiability everywhere else: On each open interval \( (-\infty, 0) \), \( (0, 1) \), \( (1, 3) \), and \( (3, \infty) \), the function is linear (with slopes \( -3 \), \( -1 \), \( 1 \), and \( 3 \) respectively). Linear functions are differentiable everywhere, so \( f \) is differentiable at every point other than \( x = 0 \), \( x = 1 \), and \( x = 3 \).
  8. Step 8 — Conclusion: Yes, such a function exists. The function \( f(x) = |x| + |x - 1| + |x - 3| \) is continuous for every \( x \in \mathbb{R} \) but is not differentiable at exactly three points, namely \( x = 0 \), \( x = 1 \), and \( x = 3 \).

Answer: Yes, such a function exists. The function \( f(x) = |x| + |x - 1| + |x - 3| \) is continuous everywhere on \( \mathbb{R} \) but fails to be differentiable at exactly three points: \( x = 0 \), \( x = 1 \), and \( x = 3 \), where the left-hand and right-hand derivatives are unequal (sharp corners in the graph).

Everything you get with Solver7

More questions in Continuity and Differentiability

Chapter 5 Examples Q1 Chapter 5 Examples Q2 Chapter 5 Examples Q3 65/1/1 2024 / Section A Q3 Chapter 5 Examples Q4 65/2/1 2024 / Section A Q4 65/3/1 2024 / Section A Q4 Chapter 5 Examples Q5 65/4/1 2026 / Section A Q5 Chapter 5 Examples Q6 65(B) 2026 / Section A Q6 65/4/1 2023 / Section A Q6 65/4/2 2024 / Section A Q6 65/5/1 2026 / Section A Q6 Chapter 5 Examples Q7 65/3/1 2026 / Section A Q7 65/4/1 2023 / Section A Q7 65/4/1 2026 / Section A Q7 65/4/2 2024 / Section A Q7 Chapter 5 Examples Q8 65/4/1 2026 / Section A Q8 65/5/1 2026 / Section A Q8 Chapter 5 Examples Q9 Chapter 5 Examples Q10 Chapter 5 Examples Q11 65/2/2 2023 / Section A Q11 65/2/3 2026 / Section A Q11 Chapter 5 Examples Q12 65/2/2 2023 / Section A Q12 Chapter 5 Examples Q13 65/1/1 2023 / Section A Q13 65/1/1 2024 / Section A Q13 65/2/1 2024 / Section A Q13 Chapter 5 Examples Q14 65/3/1 2024 / Section A Q14 Chapter 5 Examples Q15 65/3/1 2023 / Section A Q15 Chapter 5 Examples Q16 65/3/1 2023 / Section A Q16 Chapter 5 Examples Q17 Chapter 5 Examples Q18 Chapter 5 Examples Q19 Chapter 5 Examples Q20 Chapter 5 Examples Q21 65/1/1 2024 / Section B Q21(a) 65/1/1 2026 / Section B Q21(a) 65/3/1 2026 / Section B Q21 Chapter 5 Examples Q22 65/1/1 2024 / Section B Q21(b) 65/1/1 2026 / Section B Q21(b) 65/3/1 2024 / Section B Q22(a) 65/4/1 2026 / Section B Q22(a) 65/5/1 2026 / Section B Q22(a) Chapter 5 Examples Q23 65/2/1 2024 / Section B Q22(a) 65/3/1 2024 / Section B Q22(b) 65/4/1 2023 / Section B Q22 65/4/1 2026 / Section B Q22(b) 65/5/1 2026 / Section B Q22(b) Chapter 5 Examples Q24