# By the definition of continuity, how do you show that xsin(1/x) is continuous at x=0?

May 16, 2017

It is not continuous at $0$.

#### Explanation:

$f$ is continuous at $a$ if and only if ${\lim}_{x \rightarrow a} f \left(x\right) = f \left(a\right)$

If $f \left(a\right)$ does not exist, then $f$ is not continuous at $a$.

Since $0 \sin \left(\frac{1}{0}\right)$ does not exists, $x \sin \left(\frac{1}{x}\right)$ is not continuous at $0$.

May 16, 2017

The function as defined is not, but a slight modification is if we define a modified function by:

$f \left(x\right) = \left\{\begin{matrix}x \sin \left(\frac{1}{x}\right) & x \ne 0 \\ 0 & x = 0\end{matrix}\right.$

#### Explanation:

We will need the definition of continuity which is that:

$f \left(x\right)$ is continuous at $x = a \iff {\lim}_{x \rightarrow a} f \left(x\right) = f \left(a\right)$

So, in order to prove that the function defined by:

$f \left(x\right) = x \sin \left(\frac{1}{x}\right)$

Is continuous at $x = 0$ we must show that

${\lim}_{x \rightarrow 0} x \sin \left(\frac{1}{x}\right) = f \left(0\right)$

This leads is to an immediate problem as $f \left(0\right)$ is clearly undefined.

This is, however, not the end of the problem. If we look at the graph of the function, it certainly looks as though the function $f \left(x\right)$ is continuous:

graph{xsin(1/x) [-0.2034, 0.2068, -0.1015, 0.1036]}

Firstly, Let us try and establish if the above limit exists

We can very easily show the limit exists and find its value:

Method 1:

Let $z = \frac{1}{x}$ then as $x \rightarrow 0 \implies z \rightarrow \infty$

So then, the limit can be written:

${\lim}_{x \rightarrow 0} x \sin \left(\frac{1}{x}\right) = {\lim}_{z \rightarrow \infty} \left(\frac{1}{z}\right) \sin z$
$\text{ } = {\lim}_{z \rightarrow \infty} \frac{\sin z}{z}$
$\text{ } = 0$

As $| \sin \left(z\right) | \le 1$ and $\frac{1}{z} \rightarrow 0$ as $z \rightarrow \infty$

Method 2
We can also the squeeze (or sandwich) theorem. We know $\sin x$ oscillates between $\pm 1$, that is:,

$- 1 \le \sin \theta \le 1$

Let $\theta = \frac{1}{x}$ then

$- 1 \le \sin \left(\frac{1}{x}\right) \le 1$

Multiply both sides by $x$, then depending upon the sign of $x$ we have:

$x > 0 \implies - x \le x \sin \left(\frac{1}{x}\right) \le x$
$x < 0 \implies - x \ge x \sin \left(\frac{1}{x}\right) \ge x$

And since:

${\lim}_{x \rightarrow {0}^{+}} x = {\lim}_{x \rightarrow {0}^{+}} - x = 0$
${\lim}_{x \rightarrow {0}^{-}} x = {\lim}_{x \rightarrow {0}^{-}} - x = 0$

We can use the squeeze theorem to say

${\lim}_{x \rightarrow 0} x \sin \left(\frac{1}{x}\right) = 0$

So how does this help us? We have shown the limit exists, but we still have the issue with $f \left(0\right)$ being undefined. We can easily deal with this by modifying the function to explicitly define $f \left(0\right) = 0$ as follows:

$f \left(x\right) = \left\{\begin{matrix}x \sin \left(\frac{1}{x}\right) & x \ne 0 \\ 0 & x = 0\end{matrix}\right.$