On this page
The function f(x) = x sin(1/x) is a classic test case in calculus. It looks well-behaved, but as x gets close to zero, the 1/x term inside the sine function shoots towards infinity. This makes the sine wave oscillate faster and faster.
To understand its limits, we have to test it for both continuity and differentiability at the origin.
Is x sin(1/x) continuous at x = 0?
A continuous function has no abrupt jumps or breaks, meaning its limit as it approaches a point equals the function's value there (Wikipedia). The function x sin(1/x) is undefined at x = 0, but if we define f(0) = 0, we can test if the limit as x → 0 matches.
Because 1/x grows infinitely large near zero, direct substitution fails. Instead, we use the squeeze theorem (also known as the sandwich theorem). The sine function, no matter how fast it oscillates, is always trapped between -1 and 1.
If we multiply that entire inequality by x (using |x| to keep the signs correct), we get: -|x| ≤ x sin(1/x) ≤ |x|
As x approaches 0, both -|x| and |x| approach 0. The squeeze theorem states that if a function is trapped between two bounds that both converge to the same value, the function itself must converge to that value too (Wikipedia). Because the limit is 0, which matches our defined f(0) = 0, the function x sin(1/x) is continuous at x = 0.
If you are missing the fundamental concept of limit theorems, the Fermi Concept Library includes every concept in mathematics, each with its own lesson.
Is x sin(1/x) differentiable at x = 0?
For a function to be differentiable at a point, its graph must be smooth, which means the limit of its difference quotient must exist (Wikipedia).
The definition of the derivative at x = 0 is: f'(0) = limit as h → 0 of [f(0 + h) - f(0)] / h
Substitute our function and f(0) = 0: f'(0) = limit as h → 0 of [h sin(1/h) - 0] / h = limit as h → 0 of sin(1/h)
This leaves us with the limit of sin(1/h) as h goes to 0. Unlike earlier, there is no h on the outside to squeeze it down. The sine function simply oscillates between -1 and 1 infinitely often as h shrinks. It never settles on a single number. Because the limit does not exist, x sin(1/x) is not differentiable at x = 0.
Why does x² sin(1/x) behave differently?
A small change to the function changes the outcome completely. Consider g(x) = x² sin(1/x), again setting g(0) = 0.
Like the first function, it is continuous at x = 0. The squeeze theorem traps it between -x² and x², both of which shrink to zero.
The difference appears when we test for differentiability. We set up the difference quotient again: g'(0) = limit as h → 0 of [h² sin(1/h) - 0] / h = limit as h → 0 of h sin(1/h)
This limit is exactly the one we solved for continuity in the first problem. The extra power of h from the h² term survives the division. Because the limit as h → 0 of h sin(1/h) is 0, the limit of the difference quotient exists. Therefore, x² sin(1/x) is differentiable at x = 0 (Wikipedia), and its derivative there is 0.
When you are stuck on whether an extra power of x changes a derivative, a step-by-step solver can help you check the algebra. The Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than just printing an answer.
A checklist for testing limits at zero
When you face an oscillating function like xⁿ sin(1/x) on an exam, use this three-step framework to test its limits at x = 0:
Check for continuity first: Ensure the function is defined at x = 0 (usually given as f(0) = 0). Then apply the squeeze theorem to see if the bounding functions push the limit to 0. If n > 0, it is continuous.
Set up the difference quotient: Do not try to use the product rule or chain rule directly at x = 0, because those rules assume the derivative already exists. Always fall back to the limit definition: limit as h → 0 of [f(h) - f(0)] / h.
Count the surviving powers: Simplify the quotient. If an h remains on the outside of the sine function (which happens when n > 1), the squeeze theorem works again, and the derivative is 0. If no h remains (when n = 1), the sine function oscillates infinitely, the limit fails, and the function is not differentiable.
To see how these concepts build up over time, read about Karl Weierstrass and the epsilon-delta definition of a limit or learn how to classify breaks in graphs in our guide to Removable and jump discontinuities: telling them apart.



