Derivative at 0 problem

1. Oct 28, 2013

jimmyly

1. The problem statement, all variables and given/known data

f(x) = |x| + x
Does f'(0) exist? Does f'(x) exist for values of x other than 0?
This is from lang's a first course in calculus page 54 # 13

2. Relevant equations
lim (f(x+h) - f(x))/h
h->0

3. The attempt at a solution
So I'm not sure if I am doing this correctly
at first I took the derivative of f(x) = |x| + x

f(x) = |x| + x = √x^2 + x
from there

f'= lim h -> 0 (√(x+h)^2 + (x+h) - (√x^2 + x))/h
= x + h +x + h - x - x / h
= 2h/h
=2

I assumed this meant that f' = 2 but this doesn't make sense because there is no slope at x = 0

so I decided to take the right and left derivatives

right:
for x > 0, h>0
|x| = x
f'= (|x+h| + (x + h) - (|x| + x))/h = ((x+h) + (x + h) - ( x + x )) / h = 2

left:
for x < 0 , h < 0
|x| = -x

f' = (-(x+h) + (x + h) - (-x +x ))/h = -1

so my conclusion is that there is no derivative at x = 0 because the left and right derivatives do not equal.

I am not very confident in what I did here. If someone can help me understand it better I would really appreciate it!

Last edited: Oct 28, 2013
2. Oct 28, 2013

UltrafastPED

|x| does not have a derivative at zero due to the sharp point of the "V".

3. Oct 28, 2013

jimmyly

So how do I show that mathematically?
I understand that geometrically, but when I do problems like these I have a tough time doing it

4. Oct 28, 2013

jimmyly

also when I graph it out it only shows the right side / instead of V
I don't understand how I got the left derivative as -1 when there's nothing on the left

5. Oct 28, 2013

Staff: Mentor

Typo - should be f(x) = |x| + x.
You need more parentheses, as in (f(x + h) - f(x))/h
√(x + h)2 ≠ x + h. Think about the case when x + h < 0.
Your conclusion is correct, but there's an error in your work. If you sketch a graph of y = |x| + x for x < 0, it should be clear that the slope is 0, not -1

6. Oct 28, 2013

jimmyly

shouldn't f'(0) = 0 or undefined or dne since there is no derivative at 0?

7. Oct 28, 2013

Staff: Mentor

Since the derivative doesn't exist for x = 0, the f' is not defined at 0.

8. Oct 28, 2013

UltrafastPED

For x > 0 |x| = x; so the slope for x>0 is 1.
For x < 0 |x| = -x; and the slope for x<0 is -1.

These are constants, so the limit from the left (x<0) at x=0 is -1. From the right (x>0) it is +1.
So the left and right derivatives are not the same ... this is due to the kink at x=0.

So for the expression g(x) = -|x| + x you get g(x) = 0 for x>= 0, and g(x) = 2x for x < 0;
so now the slope is +2 for x<0, but it is 0 for x>0.

9. Oct 28, 2013

Staff: Mentor

The OP went back and fixed his first post. It should have been f(x) = |x| + x.

For x > 0, f'(x) = 2; for x < 0, f'(x) = 0.

10. Oct 28, 2013

jimmyly

Thanks for the replies! I fixed up the errors in my thread and added parentheses.

so I re-did the left for x<0
I got
f' = (-(x+h) + (x+h) - (-x+x))/h = (-x - h + x + h + x - x)/h = 2x/h but taking the limit as h->0 it is undefined

is it an algebraic error I am making?

11. Oct 28, 2013

jimmyly

Yeah sorry for the confusion

12. Oct 28, 2013

Staff: Mentor

The numerator isn't 2x. Check your algebra.
Yes

13. Oct 28, 2013

jimmyly

sorry

f' = (-(x+h) + (x+h) - (-x+x))/h = (-x - h + x + h + x - x)/h = 0/h not 2x/h

14. Oct 28, 2013

Staff: Mentor

Right. And in the limit, even though h → 0-, for each value of h that isn't zero, the quotient is zero, hence the limit is zero as well.

So as you found, if x > 0, f'(x) = 2, and if x < 0, f'(x) = 0. At x = 0, f' doesn't exist.

15. Oct 28, 2013

jimmyly

I completely understand now! thank you so much for your help and clarity, I appreciate it!

16. Oct 29, 2013

Ray Vickson

You have already done it: you showed that the left- and right-derivatives are unequal, so there cannot be a limit of [f(h) - f(0)]/h as h → 0.

Note that h → 0 means that h is allowed to have either sign, as long as its magnitude goes to 0. If we want to specify a direction of approach to 0 we must write either h → 0+ or h → 0-.