Derivative of abs(x) - Proof and Explanation

Proof

We start by defining the absolute value function, |x|, as a piecewise function:

|x|={xif x0xif x<0

To find the derivative, we differentiate each piece separately:

  1. For x0:

    ddx(x)=1
  2. For x<0:

    ddx(x)=1

Combining these results, we get:

ddx|x|={1if x>01if x<0

At x=0, the function |x| is continuous, but its derivative is not defined because the left-hand limit (1) and the right-hand limit (1) are not equal.

Another way to express the derivative of |x| is using the function x|x|. This function is defined as:

x|x|={1if x>01if x<0undefinedif x=0

Thus, the derivative of |x| is:

ddx|x|=x|x|

Explanation

To understand the derivative of the absolute value function |x|, let’s break it down step by step.

The absolute value function |x| is defined differently for positive and negative values of x. Specifically:

|x|={xif x0xif x<0

This means that for any non-negative value of x (including zero), |x| is just x, and for any negative value of x, |x| is x.

To find the derivative of |x|, we need to consider these two cases separately:

  1. When x0, the function |x| is equal to x. The derivative of x with respect to x is 1.

  2. When x<0, the function |x| is equal to x. The derivative of x with respect to x is 1.

Putting these two results together, we get:

ddx|x|={1if x>01if x<0

At x=0, the situation is different. The function |x| is continuous at x=0, but its derivative is not defined. This is because the left-hand limit of the derivative as x approaches 0 from the negative side is 1, and the right-hand limit as x approaches 0 from the positive side is 1. Since these two limits are not equal, the derivative at x=0 does not exist.

Another way to express this derivative more compactly is by using the function x|x|. This function gives us the sign of x:

x|x|={1if x>01if x<0

At x=0, this expression is undefined because we cannot divide by zero. Therefore, the derivative of |x| can be written as:

ddx|x|=x|x|

Thus, the derivative of the absolute value function |x| is x|x|, which is 1 for positive x, 1 for negative x, and undefined at x=0.

Q.E.D.