Show that $g'(0)\neq \lim_{x\to 0} g'(x)$

Use the limit definition to show that $g'(0)$ exists but $g'(0)\neq \lim_{x\to 0} g'(x)$, where

$$g(x)=\begin{cases}x^2\sin\frac1x,&\text{when }x\neq0\\\\ 0,&\text{when }x=0\end{cases}$$

I find that when $x\neq 0$, $g'(x)=2x \sin\dfrac1x-\cos\dfrac1x$.

My problem is that when I can't compute

$$\lim_{x\to0}g'(x)=2\lim_{x\to0}x \sin\frac1x-\lim_{x\to0}\cos\frac1x$$

question from Rogawski, Jon. Calculus Single Variable. 2nd ed. New York: W.H. Freeman, 2012. Print.

-
I think a mistake I made is I didn't use the limit definition yet, rather I directly computed g'(x) at $x\neq0$. –  raindrop Nov 4 '12 at 21:57
I’m pretty sure that you’re expected to use ordinary differentiation formulas to handle $g'(x)$ for non-zero $x$; it’s only at $0$ that you need the limit definition. But for that you will have to go back to the difference quotient at $0$: $$g'(0)=\lim_{h\to 0}\frac{g(0+h)-g(0)}h\;.$$ –  Brian M. Scott Nov 4 '12 at 21:59
Information on $lim_{x\to0}g'(x)$ wolframalpha.com/input/?i=limit+2xsin(1%2fx)-cos(1%2fx) –  raindrop Nov 4 '12 at 22:12
Using Brian's equation, I find $lim_{x\to0}g'(x)=0$ –  raindrop Nov 4 '12 at 22:14
Yes: $h\to 0$, and $\sin\frac1h$ is bounded, so the product $\to0$. –  Brian M. Scott Nov 4 '12 at 22:17

Here’s a pretty large for showing that $g'(0)$ exists. By definition

$$g'(0)=\lim_{h\to 0}\frac{g(0+h)-g(0)}h=\lim_{h\to0}\frac{g(h)}h=\lim_{h\to 0}\frac{h^2\sin\frac1h}h=\lim_{h\to 0}h\sin\frac1h\;;\tag{1}$$

can you evaluate that last limit?

For the rest, you already have

$$\lim_{x\to0}g'(x)=2\lim_{x\to0}x \sin\frac1x-\lim_{x\to0}\cos\frac1x\;.$$

The first limit on the righthand side is the same as the limit in $(1)$, and since $\cos\frac1x$ oscillates between $1$ and $-1$ infinitely often as $x\to 0$, the second limit on the righthand side doesn’t exist. But as N.S. already pointed out, if $\lim_{x\to0}g'(x)$ existed, so would

$$\lim_{x\to0}\cos\frac1x=2\lim_{x\to0}x \sin\frac1x-\lim_{x\to0}g'(x)\;;$$

since it doesn’t, neither does $\lim_{x\to0}g'(x)t$.

-
yeah it's 0.wolframalpha.com/input/?i=limit+h+sin+1%2Fh –  raindrop Nov 4 '12 at 22:32
It seems to me that $g'(0)=\lim_{x\to 0} g'(x)$ so I can't prove $g'(0)\neq \lim_{x\to 0} g'(x)$ –  raindrop Nov 4 '12 at 22:36
@Raindrop: How can they be equal when one of them is $0$ and the other doesn’t exist? –  Brian M. Scott Nov 4 '12 at 22:37
The limit $\lim_{x\to0}g'(x)=2\lim_{x\to0}x \sin\frac1x-\lim_{x\to0}\cos\frac1x$ doesn't exist but the limit $g'(0)=\lim_{h\to 0}\frac{g(0+h)-g(0)}h=\lim_{h\to0}\frac{g(h)}h=\lim_{h\to 0}\frac{h^2\sin\frac1h}h=\lim_{h\to 0}h\sin\frac1h\;;\tag{1}$ exists –  raindrop Nov 4 '12 at 22:40
@Raindrop: Now you’ve got it. And in case you were wondering, the point of this problem is that even though $g'(x)$ exists everywhere, it’s not continuous at $x=0$. This is an example of a function that is differentiable, but not continuously differentiable. –  Brian M. Scott Nov 4 '12 at 23:06

Assume by contradiction that $\lim_{x \to 0} g'(x)$ exists. Then

$$\lim_{x\to0}g'(x)-2\lim_{x\to0}x \sin(1/x)$$

also exists, thus $\lim_{x \to 0} \cos(\frac{1}{x})$ exists.

Alternatelly, find two different sequences, $x_n, y_n$ so that

$$\lim_n g'(x_n)=0$$ $$\lim_n g'(y_n)=1$$

-