Functions similar to $f(x) = x^2 \sin{\frac{1}{x}}$

80 Views Asked by At

I am analysing this function: $f(x) = x^2 \sin{\frac{1}{x}}$

enter image description here The specific feature of this function that I am interested in is the increasing smoothness as you move away from zero. Are there similar functions to this one exhibiting continuous increase/decrease in smoothness with the change in $x$?

1

There are 1 best solutions below

0
On BEST ANSWER

If by 'smoothness' you mean 'number of derivatives', the function $f(x)=x^2\sin(\frac{1}{x})$ has the same degree of smoothness in every point different from $0$.

If you were talking about those small sharp edges that the graph seems to plot when $x\in (5\cdot 10^{-4}, 0.0015)$, forget about them. They are not accurate. Those sharp edges appear as a consequence of the floating-point representation of the numbers in the computer. In brief, when a computer has to perform a calculation that deals with both 'large' and 'small' numbers, these inaccurate results may appear.

This exact behavior is happening with your function. If you consider $x\in (5\cdot 10^{-4}, 0.0015)$, we could say that $x$ is small(from a 32-bits-floating-point point of view). Hence, $\dfrac{1}{x}$ is large. This is the reason why the calculation involving the numbers in this range is not 100% accurate.

This behavior can be seen with other functions where large and small numbers are involved, such as $$f(x)=\sin\left(\dfrac{1}{x^4}\right)$$ for large values of $x$, or $$f(x)=\left(9^{-9}\right)^{1/x}$$ for small values of $x$.