# Thread: continuity / differentiability problem

1. ## continuity / differentiability problem

this problem i know how to do ("</=" means less than or equal to)

f(x) = x^2 , x </= 1
x^(1/2) , x > 1

f(1) = 1^2 = 1
lim f(x) = 1
x~> 1+
lim f(x) = 1
x~> 1-
since f(1) = lim f(x) = 1
x~> 1
the piecewise function is continuous at x = 1. then to check differentiability i took the derivative:
f'(x) = 2x , x </= 1
1/2x^(1/2) , x > 1

f'(1) = 2
lim f'(x) = 1/2
x~> 1+
lim f'(x) = 2
x~> 1-
since f'(1) =/= lim f'(x)
x~> 1
the derivative of the function is not continuous at x = 1 which means the two functions meets at x = 1 with different slopes so the function is not differentiable at x = 1.

f(x) = x^2 cos(1/x), x=/= 0
0 , x = 0

f(0) = 0
lim f(x) = 0 (by the squeeze theorem)
x~> 0
since f(0) = lim f(x)
x~>0
the function is continuous at x = 0. then to check differentiability i took the derivative:
f'(x) = sin(1/x) + 2x cos(1/x), x =/= 0 (i used the product and chain rules)
0 , x = 0

f'(0) = 0
lim f'(x) = DNE (since sin(1/x) oscillates between 1 and -1)
x~>0

therefore i concluded that since f'(0) =/= lim f'(x)
x~>0
the function was not differentiable at x = 0 since the derivative wasn't continuous at x = 0 which meant that the 2 functions met with different slopes at x = 0. but on many websites with this same problem, it says that it's differentiable at ALL x. how is this possible? i don't understand how the logic from the first problem i did couldn't be applied to this problem. help will be very much appreciated!

2. The derivative of $\cos{\frac{1}{x}}=(-\sin\frac{1}{x})(-\frac{1}{x^2})=\frac{1}{x^2}\sin\frac{1}{x}$

So by the product rule we have

$x^2*\frac{1}{x^2}\sin\frac{1}{x}+\cos\frac{1}{x}*2 x\Longleftrightarrow\sin\frac{1}{x}+2x\cos\frac{1} {x}$

I'm sorry, I was focused on the wrong thing.

The function is defined everywhere, is it not? So as $x\to0$ you are right in saying that $f(x)$ osillates $\mid{f(x)}\mid\leq{1}$, but the fuction has been defined to be 0 when x=0, therefore the function ossilates from the left and the right, but when x reaches 0 $f(x)=0$, and therefore, $\lim_{x\to{0}}f(x)=0$. Further more, $\lim_{x\to0}f(x)=f(0)$.

Does that help at all?

3. The derivative at 0 is $\lim_{h\rightarrow 0}\frac{f(h)- f(0)}{h}$ which is $\lim_{h\rightarrow 0} \frac{h^2 cos(1/h)}{h}$ $= \lim_{h\rightarrow 0} h cos(1/h)= 0$

It is true that, for this function, $\lim_{x\rightarrow 0} f'(x)$ does not exist so this derivative is not continuous at 0, but the derivative does exist at x= 0.