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.

however i'm not sure about this next problem:

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!