# Testing for Continuity using Sandwich Theorem

Given the function $f(n) = \begin{cases} x\sin (1/x), & x \neq 0 \\ 0, & x=0 \end{cases}$

describe the interval on which the function is continuous.

This function is a similar one to the one I asked about recently but the oscillations are damped by a factor of x

The solution says that you use the sandwich theorem to get:

$-|x| \leq x\sin (1/x) \leq |x|$, where $x\neq 0$

I was confused on where it got the $|x|$ in the inequality.

• The inequality uses $|x|$ because $\sin\theta$ varies from $-1$ to $1$ – AEngineer Jun 11 '18 at 19:17
• Where did the 7 come from? – Xander Henderson Jun 11 '18 at 19:26
• @XanderHenderson not supposed to be these. Removed it, sorry – Aniket Jun 14 '18 at 13:42

Notice that $$-1 \le \sin(\theta) \le 1,$$ regardless of the value of $\theta$. This means that for any value of $x$ (other than zero), we have $$-1 \le \sin\left(\frac{1}{x}\right) \le 1.$$ We would like to hit this inequality with a factor of $x$, but there is a slight problem: multiplication by a negative number reverses the direction of the inequalities. So, we can work in cases:
• If $x > 0$, then $$-1 \le \sin\left(\frac{1}{x}\right) \le 1 \implies -x \le x\sin\left(\frac{1}{x}\right) \le x.$$ Since $x > 0$, we have $|x| = x$, and so this inequality can be written as $$-|x| \le x\sin\left(\frac{1}{x}\right) \le |x|.$$
• If $x < 0$, then $$-1 \le \sin\left(\frac{1}{x}\right) \le 1 \implies -x \ge x\sin\left(\frac{1}{x}\right) \ge x \implies x \le x\sin\left(\frac{1}{x}\right) \le -x.$$ Here, $x < 0$, and so $|x| = -x$ (which implies that $-|x| = x$). Thus the inequality can also be written as $$-|x| \le x\sin\left(\frac{1}{x}\right) \le |x|.$$