# Finding the Derivative of |x| using the Limit Definition

Please Help me derive the derivative of the absolute value of x using the following limit definition. $$\lim_{\Delta x\rightarrow 0}\frac{f(x+\Delta x)-f(x)}{\Delta x}$$ I have no idea as to how to get started.Please Help.

Thank You

• Does $|x|$ differentiable at zero? Nov 20, 2011 at 11:25

$\dfrac{d}{dx}|x|$

$=\lim\limits_{\Delta x\to 0}\dfrac{|x+\Delta x|-|x|}{\Delta x}$

$=\lim\limits_{\Delta x\to 0}\dfrac{(|x+\Delta x|-|x|)(|x+\Delta x|+|x|)}{\Delta x(|x+\Delta x|+|x|)}$

$=\lim\limits_{\Delta x\to 0}\dfrac{|x+\Delta x|^2-|x|^2}{\Delta x(|x+\Delta x|+|x|)}$

$=\lim\limits_{\Delta x\to 0}\dfrac{(x+\Delta x)^2-x^2}{\Delta x(|x+\Delta x|+|x|)}$

$=\lim\limits_{\Delta x\to 0}\dfrac{x^2+2x\Delta x+(\Delta x)^2-x^2}{\Delta x(|x+\Delta x|+|x|)}$

$=\lim\limits_{\Delta x\to 0}\dfrac{2x+\Delta x}{|x+\Delta x|+|x|}$

$=\dfrac{x}{|x|}$

$=\dfrac{x|x|}{|x|^2}$

$=\dfrac{x|x|}{x^2}$

$=\dfrac{|x|}{x}$

• Can you show the further derivatives? Jan 9, 2019 at 15:16
• @MathLover use quotient rule. $\frac{d}{dx} \frac{|x|}{x}=\frac{\frac{|x|}{x} \cdot x - |x| \cdot 1}{x^2}$ Oct 7, 2021 at 7:18

Since the absolute value is defined by cases, $$|x|=\left\{\begin{array}{ll} x & \text{if }x\geq 0;\\ -x & \text{if }x\lt 0, \end{array}\right.$$ it makes sense to deal separately with the cases of $x\gt 0$, $x\lt 0$, and $x=0$.

For $x\gt0$, for $\Delta x$ sufficiently close to $0$ we will have $x+\Delta x\gt 0$. So $f(x)= |x| = x$, and $f(x+\Delta x) = |x+\Delta x| = x+\Delta x$; plugging that into the limit, we have: $$\lim_{\Delta x\to 0}\frac{f(x+\Delta x) - f(x)}{\Delta x} = \lim_{\Delta x\to 0}\frac{|x+\Delta x|-|x|}{\Delta x} = \lim_{\Delta x\to 0}\frac{(x+\Delta x)-x}{\Delta x}.$$ You should be able to finish it now.

For $x\lt 0$, for $\Delta x$ sufficiently close to zero we will have $x+\Delta x\lt 0$; so $f(x) = -x$ and $f(x+\Delta x) = -(x+\Delta x)$. It should again be easy to finish it.

The tricky one is $x=0$. I suggest using one-sided limits. For the limit as $\Delta x\to 0^+$, $x+\Delta x = \Delta x\gt 0$; for $\Delta x \to 0^-$, $x+\Delta x = \Delta x\lt 0$; the (one-sided) limits should now be straightforward.

• If i plug in the given function into the derivative formula i get $$\lim_{\Delta x\rightarrow 0}\frac{f(x+\Delta x) - x}{\Delta x}$$.Upon evaluating it i get the final answer as 1
– alok
Nov 20, 2011 at 7:22
• @alok: Notice that you'll get different result for $x<0, x>0$, and $x=0$.
– ofer
Nov 20, 2011 at 7:37
• @alok: Be sure to keep track of what case you are in! You will not get $1$ except when $x\gt 0$, or when $x=0$ and $\Delta x\to 0^+$. If you are getting $1$ in all cases, you are doing it wrong. Nov 20, 2011 at 21:46
• The derivative does not exist at 0! Jun 12, 2016 at 2:28

We can write $|x| = \sqrt{x^2}$. Using the chain rule we then get $$|x|' = \frac{1}{2\sqrt{x^2}} \cdot 2x = \frac{x}{\sqrt{x^2}} = \frac{x}{|x|}$$

EDIT Using limit: \begin{align} \frac{\sqrt{(x+\Delta x)^2}-\sqrt{x^2}}{\Delta x} & = \frac{(\sqrt{(x+\Delta x)^2}-\sqrt{x^2})(\sqrt{(x+\Delta x)^2}+\sqrt{x^2})}{\Delta x (\sqrt{(x+\Delta x)^2}+\sqrt{x^2})} \\ & = \frac{(x+\Delta x)^2-x^2}{\Delta x (\sqrt{(x+\Delta x)^2}+\sqrt{x^2})} \\ & = \frac{2 x \Delta x + \Delta x^2}{\Delta x (\sqrt{(x+\Delta x)^2}+\sqrt{x^2})} \\ & = \frac{2x + \Delta x}{\sqrt{(x+\Delta x)^2}+\sqrt{x^2}} \\ & \to \frac{2x}{\sqrt{x^2}+\sqrt{x^2}} = \frac{2x}{2|x|} = \frac{x}{|x|} \end{align}

• The OP wants to obtain the result using only the definition, nothing more. May 31, 2017 at 7:11
• I think there is a typo in the first method, the last squality should be $\dfrac {x}{\sqrt {x^2}} = \dfrac {x}{|x|}$?
– Ovi
May 31, 2017 at 12:01
• Oh, you're correct, I've missed ${}^2$. Will now fix it. May 31, 2017 at 12:14

Cheap, non-rigorous, non-mathematical, engineering-type answer: sgn(x) ("signum x", the sign of x, being -1 for x<0 and +1 for x>0). Note that sgn(0) = 0, which is a practical compromise, being the average of -1 ("coming from the negatives") and +1 ("coming from the positives").

Of course we all know that d|x|/dx is not defined at x=0. Intuitively: the "tangent" of |x| at x=0 can be any line with slope -1 < s < +1 . So it is not unique. Hence: no derivative at that point.

Once again: these are not rigorous considerations (see @doraemonpaul 's answer for proper maths), but rather intuitive hints that help you grasp the issue.

Mathematica's answer (Version 11) is even more pragmatic: D[Abs[x], x] ==> Abs'[x] . I like it a lot :-)

Well, the simple answer is if x < 0, it's obviously a linear line with a slope of -1, and when x > 0, it's a line with slope 1, and at x = 0, both formulas can be used and therefore we can't calculate the derivate.

So:

when x > 0, |x|' = 1

when x < 0, |x|' = -1

when x = 0, |x|' is undefined

As doraemonpaul said, the implicit way to say this is |x|/x, because it returns the sign of x, except when x = 0, when dividing by 0 makes it undefined.

x/|x| could also work.

• What is a linear line? :)
– R_D
Nov 8, 2016 at 4:14

One can cast this question about the differentiation of absolute value operator into the more general setting of (partial) differentiation of the Euclidean norm. This article gives the formula in $$\mathbb{R^n}$$ with coordiantes $$x=(x_1,x_2,\cdots x_n)$$ :

$$\dfrac{\partial}{\partial x_k}\|x\|=\dfrac{x_k}{\|x\|}$$

Considering the case $$n=1$$, one gets :

$$\dfrac{ \mathrm{d}}{ \mathrm{d}x}\|x\|=\dfrac{x}{|x|}$$

Using alternative limit definition of the derivative of function:

$$\lim_\limits{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0}=\lim_\limits{x\to x_0}\frac{|x|-|x_0|}{x-x_0}=\lim_\limits{x\to x_0}\frac{(|x|-|x_0|)(|x|+|x_0|)}{(x-x_0)(|x|+|x_0|)}=$$ $$\lim_\limits{x\to x_0}\frac{x^2-x_0^2}{(x-x_0)(|x|+|x_0|)}=\lim_\limits{x\to x_0}\frac{(x-x_0)(x+x_0)}{(x-x_0)(|x|+|x_0|)}=\lim_\limits{x\to x_0}\frac{x+x_0}{|x|+|x_0|}=\frac{2x_0}{2|x_0|}=\frac{x_0}{|x_0|}.$$