f(x):=x^2*sin(1/x);
define(g(x),diff(f(x),x));
plot2d(g(x), [x, 0.001, 0.01], [nticks,1000]);