# Is the derivative of 0, 0 in this case?

aygonzalezm
1. Let f(x)= {x^2 sin (1/x) when x≠0 and 0 when x=0

2. Find f'(x). Does it exist for every x? (Hint: the case when x=0 needs special attention)

3. What I did is, I found the derivative of x^2 sin (1/x). That is, 2xsin(1/x)-cos(1/x). Then I figured the derivative of 0 is just 0 since its a constant. So I left it that way, as a piece-wise function. It seems too easy to be true. I'm not sure if I'm doing it correctly.

christoff
1. I found the derivative of x^2 sin (1/x). That is, 2xsin(1/x)-cos(1/x). Then I figured the derivative of 0 is just 0 since its a constant. So I left it that way, as a piece-wise function.

When you say "the derivative of 0 is just 0", you are no longer in any way talking about the derivative of f(x) (as given in your problem). The derivative at a point depends on what your function is doing very close to that point as well. By "calculating" the derivative of f at zero the way you have, you're ignoring the properties of f AROUND zero.

What happens when you try to calculate the derivative at zero using the limit definition? (<-- try this) As it turns out, the derivative actually does exist everywhere. However, this isn't always the case.

For example, if you were to try doing the same thing with
g(x)=xsin(1/x) for x≠0 and g(0)=0,
you would get in trouble. This function is NOT differentiable at zero, even though its derivative exists everywhere except x=0, and g(0)=0.

This function g is nearly identical to f, and illustrates why your approach, although it got you the correct answer this time, does not always.

Last edited: