Show that f(x)=|x| is continuous but not differentiable at x=0

medium 3 min read

Question

Show that f(x)=xf(x) = |x| is continuous at x=0x = 0 but not differentiable at x=0x = 0.

Solution — Step by Step

f(x)=x={xif x0xif x<0f(x) = |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}

This piecewise form is essential — it lets us check left-hand and right-hand limits separately.

For f(x)f(x) to be continuous at x=0x = 0, we need:

limx0f(x)=limx0+f(x)=f(0)\lim_{x \to 0^-} f(x) = \lim_{x \to 0^+} f(x) = f(0)

Left-hand limit: limx0f(x)=limx0(x)=0\lim_{x \to 0^-} f(x) = \lim_{x \to 0^-} (-x) = 0

Right-hand limit: limx0+f(x)=limx0+(x)=0\lim_{x \to 0^+} f(x) = \lim_{x \to 0^+} (x) = 0

Value at x = 0: f(0)=0=0f(0) = |0| = 0

Since LHL = RHL = f(0) = 0, f(x)=xf(x) = |x| is continuous at x=0x = 0. ✓

For differentiability, we need:

limh0f(0+h)f(0)h to exist\lim_{h \to 0} \frac{f(0+h) - f(0)}{h} \text{ to exist}

This means the left-hand derivative (LHD) must equal the right-hand derivative (RHD).

RHD (h → 0⁺):

limh0+f(0+h)f(0)h=limh0+h0h=limh0+hh=1\lim_{h \to 0^+} \frac{f(0+h) - f(0)}{h} = \lim_{h \to 0^+} \frac{|h| - 0}{h} = \lim_{h \to 0^+} \frac{h}{h} = 1

LHD (h → 0⁻):

limh0f(0+h)f(0)h=limh0h0h=limh0hh=1\lim_{h \to 0^-} \frac{f(0+h) - f(0)}{h} = \lim_{h \to 0^-} \frac{|h| - 0}{h} = \lim_{h \to 0^-} \frac{-h}{h} = -1

Since LHD = 11-1 \neq 1 = RHD, the derivative does not exist at x=0x = 0.

f(x)=xf(x) = |x| is NOT differentiable at x=0x = 0.

This is reflected geometrically: the graph of x|x| has a sharp corner (or “kink”) at the origin. A function is differentiable where its graph is smooth — at a corner, the tangent line is not uniquely defined.

Why This Works

Continuity asks: “Does the function value agree with the limit?” — it’s about the y-values matching.

Differentiability asks a sharper question: “Does the function have a well-defined tangent slope?” — it’s about the rate of change approaching from both sides.

For x|x|, approaching from the right the slope is +1 (the function is y=xy = x), but from the left the slope is -1 (the function is y=xy = -x). These disagree at the corner, so no derivative exists.

The key theorem: Differentiability implies continuity, but continuity does NOT imply differentiability. x|x| at x=0x = 0 is the classic example of this gap.

Common Mistake

Students often stop at showing continuity and forget the second part (non-differentiability). Or they compute f(x)=sgn(x)f'(x) = \text{sgn}(x) and say “derivative at 0 is undefined” without showing the LHD/RHD mismatch. For CBSE Class 12 board exams, the examiner wants to see both LHD and RHD calculated explicitly, with the conclusion that LHD ≠ RHD.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next