# How to differentiate an absolut value, f(x)=│x^2-4│

1. Apr 30, 2005

### gillgill

how do u differentiate f(x)=│x^2-4│....?
i don't know how to do it with absolute values...

2. Apr 30, 2005

### cepheid

Staff Emeritus
If I remember right, define it in a piecewise fashion. Can you see that:

|x^2 - 4| = x^2 - 4 if x^2 - 4 > 0

|x^2 - 4| = -(x^2 - 4) if x^2 - 4 < 0

The first condition becomes: if x^2 > 4 ===> |x| > 2, i.e. if x > 2 OR x < -2

The second becomes: if x^2 < 4 ===> |x| < 2, i.e. -2 < x < 2

So you have two cases. For x > 2 and x < -2, the function is:

f(x) = x^2 - 4, and you can differentiate it.

For -2 < x < 2, the function is:

f(x) = -x^2 + 4, and you can differentiate it.

The function is differentiable at x = 2 and x = -2 if and only if the left and right hand derivatives exist at those points.

3. Apr 30, 2005

### arildno

It is quite instructive to use the DEFINITION of the derivative at the problem points 2 and -2.
I'll take the "2"-case:
In general, we have:
$$f'(2)=\lim_{\bigtriangleup{x}\to{0}}\frac{f(2+\bigtriangleup{x})-f(2)}{\bigtriangleup{x}}$$
if it exists.
In our case, $$f(x)=|x^{2}-4|$$
which implies $$f(2)=0,f(2+\bigtriangleup{x})=|(2+\bigtriangleup{x})^{2}-4|=|4\bigtriangleup{x}+(\bigtriangleup{x})^{2}|$$
Hence, we must have:
$$f'(2)=\lim_{\bigtriangleup{x}\to0}\frac{|\bigtriangleup{x}|}{\bigtriangleup{x}}|4+\bigtriangleup{x}|$$
if it exists.
Can it exist?

4. Apr 30, 2005

### gillgill

i found the first reply easier to understand...
f(x)=x^2-4
f'(x)=2x
f'(x) as x->2+ would equal 2(2)=4

f(x)=-x^2+4
f'(x)=-2x
f'(x) as x->2- would equal -2(2)=-4
so does not exist at x=2

f(x)=x^2-4
f'(x)=2x
f'(x) as x->-2- would equal 2(-2)=-4

f(x)=-x^2+4
f'(x)=-2x
f'(x) as x->-2+ would equal -2(-2)=4
so does not exist at x=-2
is that right?

5. Apr 30, 2005

### Pyrrhus

Yes that's right, because the limit does not exist therefore the derivative does not exist at those points.

6. Apr 30, 2005

### gillgill

okay...i see...thanks guys...