Question:medium

Let \( f(x) = |x| + |x-1| + |x+1| \) be a function defined on \( \mathbb{R} \), then \( f(x) \) is:

Show Hint

A function involving a sum of absolute values, \( \sum |x-a_i| \), will generally be non-differentiable at each point \(x=a_i\). To check, you don't always need to write out the full piecewise function. You can just check if the sum of the derivatives of the arguments changes sign at that point. For example at \(x=1\), the derivatives of \(x, x-1, x+1\) are \(1,1,1\). The signs of the absolute values are \(+, -, +\) just below 1, and \(+,+,+\) just above 1. The derivative just below 1 is \(+1 -1 +1 = 1\). The derivative just above 1 is \(+1+1+1=3\). Since \(1 \neq 3\), it's not differentiable.
Updated On: Feb 10, 2026
  • differentiable for all \( x \in \mathbb{R} \)
  • differentiable for all \( x \in \mathbb{R} \) other than \( x = -1, 0, 1 \)
  • differentiable only for \( x = -1, 0, 1 \)
  • not differentiable at any real point
Show Solution

The Correct Option is B

Solution and Explanation

To determine where the function \( f(x) = |x| + |x-1| + |x+1| \) is differentiable, we analyze the behavior of the function at potentially problematic points, where the absolute value expressions may change form. These points are where each absolute value term might change sign:

  • \(|x|\) changes form at \(x = 0\).
  • \(|x-1|\) changes form at \(x = 1\).
  • \(|x+1|\) changes form at \(x = -1\).

Thus, the points of interest for differentiability are \(x = -1\)\(x = 0\), and \(x = 1\).

Let's examine the function on the intervals determined by these points:

  1. For \(x < -1\): All terms are positive, so \(f(x) = -x - (x-1) - (x+1) = -3x + 0 = -3x\), which is differentiable, and \(f'(x) = -3\).
  2. For \(x = -1\): The function changes its form; hence, we check differentiability by calculating the limit of difference quotient from both sides:
    • \(\lim_{{h \to 0^-}} \frac{f(-1 + h) - f(-1)}{h} \neq \lim_{{h \to 0^+}} \frac{f(-1 + h) - f(-1)}{h}\). Not differentiable at \(x = -1\).
  3. For \(-1 < x < 0\): The first term remains negative while the others become positive, so \(f(x) = -x + (1-x) - (x+1) = 2 - 3x\), also differentiable.
  4. For \(x = 0\): The function changes its form again; limits do not match, hence, not differentiable.
  5. For \(0 < x < 1\): Here, \(f(x) = x - (x-1) - (x+1) = 1\), differentiable since it is a constant function with \(f'(x) = 0\).
  6. For \(x = 1\): Change in form occurs, not differentiable as proven by mismatch in limits.
  7. For \(x > 1\): All terms positive again, \(f(x) = x + (x-1) + (x+1) = 3x\), and differentiable with \(f'(x) = 3\).

Thus, the function \( f(x) \) is differentiable for all \( x \in \mathbb{R} \) except at \( x = -1, 0, 1 \).

The correct answer is: Differentiable for all \( x \in \mathbb{R} \) other than \( x = -1, 0, 1 \).

Was this answer helpful?
0