# Prove the continuity of $x \sin(x)$ using $\epsilon -\delta$ method.

I have been trying to prove the continuity of the function: $f:\mathbb{R}\to \mathbb{R}, f(x) =x \sin(x)$ using the $\epsilon -\delta$ method.

The particular objective of posting this question is to understand the dependence of $\delta$ on $\epsilon$ and $x$. I know that $f(x) =x \sin(x)$ is not uniformly continuous, so $\delta$ depends on both. Here is my attempt:

We need to prove that $\forall \epsilon > 0 \: \exists\, \delta(\epsilon,x) >0$ such that $\lvert x - y \rvert < \delta \implies \lvert x \sin(x) - y \sin(y)\rvert < \epsilon$.

Let $x=2n\pi$ and $y=x-\frac{\delta}{2}$ so that $\lvert x - y \rvert < \delta$.

Then, \begin{align} \bigl\lvert x \sin(x) - y \sin(y)\bigr\rvert&=\biggl\lvert 2n\pi \sin(2n\pi) - (2n\pi-\frac{\delta}{2})\sin(2n\pi-\frac{\delta}{2})\biggr\rvert\\ &= \biggl\lvert (2n\pi-\frac{\delta}{2}) \: \sin(2n\pi-\frac{\delta}{2})\biggr\rvert \end{align} Now, \begin{align} \biggl\lvert (2n\pi-\frac{\delta}{2}) \sin(2n\pi-\frac{\delta}{2})\biggr\rvert \leq \biggl\lvert (2n\pi-\frac{\delta}{2}) \biggr\rvert \leq \epsilon \end{align} and hence, a $\delta$ chosen such as $4n\pi + 2\epsilon$ can be used. Since, this choice depends on $4n\pi$ which is $2x$ and $2\epsilon$, hence the function is continuous but not uniformly so.

Is my procedure correct? How can I prove it generally so $\forall x$?

• You chose a very particular value of $\;x\;$ . If at all, and I didn't check your work that carefully, that'd prove continuity in that one single, particular point. – DonAntonio Nov 30 '17 at 18:47
• The mistake is where you state "let $x=2n\pi$...". You cannot pick and choose $x$, your statement must be valid for every $x$. (Otherwise, you've proven continuity only for some $x$.) – user491874 Nov 30 '17 at 18:50
• Okay, thank you very much, I have edited the question. – InMyOwn Euclidean space Nov 30 '17 at 18:52
• Also, you cannot pick and choose $y=x-\frac{\delta}{2}$. Your statement must be valid for every $y$ in the range $(x-\delta,x+\delta)$ - you may need to choose a smaller $\delta$ for that. – user491874 Nov 30 '17 at 18:54

Forget about $2n\pi$ and stuff. The essential point is that $|\sin x-\sin y|\leq |x-y|$ for arbitrary $x$, $y\in{\mathbb R}$.

Let an $x\in{\mathbb R}$ be given and consider an increment $h$ with $|h|\leq1$ applied at $x$. Then \eqalign{\bigl|(x+h)\sin(x+h)-x\sin x\bigr|&=\bigl|(x+h)(\sin(x+h)-\sin x)+h\sin x\bigr|\cr&\leq|h|\bigl(|x+h|+|\sin x|\bigr)\cr&\leq |h|\bigl(|x|+2\bigr)\ .\cr} Given an $\epsilon>0$ we therefore can choose $$\delta:={\epsilon\over|x|+2}$$ in order to satisfy the standard $\epsilon/\delta$-requirement.

But be aware that the claim immediately follows from the continuity of the product $(x,y)\mapsto xy$ on ${\mathbb R}^2$ and standard facts about continuity.

• Thank you, I was having trouble in formulating arguments to establish the proof for a general $x$. – InMyOwn Euclidean space Nov 30 '17 at 19:42

Hint: $|x\sin x-y\sin y|=|x\sin x-x \sin y+x\sin y-y\sin y|\le 2|x||\cos\frac {x+y}{2}||\sin\frac {x-y}{2}|+|x-y||\sin y|\le |x||x-y|+|x-y|=(|x|+1)|x-y|$ so use $\delta=\frac {\varepsilon}{|x|+1}$. I have used the facts that, for every $x$, $|\sin x|, |\cos x|\le 1$, $|\sin x|\le|x|$.

• The general idea here is, of course, to limit $|f (x)-f (y)|$ from above with something that depends on $|x-y|$ and possibly on $x$ in such way that that 'something' can be made arbitrarily small with small $|x-y|$. – user491874 Nov 30 '17 at 19:31
• Another takeaway for you is this merhod of estimation. If $f (x)=g (x)h (x)$, then the step $|g (x)h (x)-g (y)h (y)|\le|g (x)||h (x)-h (y)|+|g (x)-g (y)||h (y)|$ is a standard step that you will see in many proofs in calculus and so it is good to see it working here. Otherwise you might wonder how on Earth you would think of such a proof - as I said it is a fairly standard step, and after seeing it a few times it will be the first thing to come to mind! – user491874 Nov 30 '17 at 19:46
• Thank you, your answer and comments are both very useful in helping to understand some standard ways of approach to a problem. – InMyOwn Euclidean space Nov 30 '17 at 23:00

Basic approach. Use the fact that the slope of $\sin x$ is everywhere between $-1$ and $1$, so the slope of $x\sin x$ at any point $x$ is guaranteed to be between $-x-1$ and $x+1$. (Thanks to YvesDaoust for the catch.) Thus, if you want to get the function to within $\varepsilon$, you need to get your neighborhood to have radius no greater than $\delta = \frac{\varepsilon}{x+1}$.

Formalize the above and it should work.

• No, the slope of $x\sin x$ is not guaranteed to be between $-x$ and $x$. Take $x=1$ for instance. – Yves Daoust Nov 30 '17 at 19:06
• @YvesDaoust: Yes, of course, silly mistake. Thanks for the catch. – Brian Tung Nov 30 '17 at 19:27
• I was trying to use the Mean Value theorem to do something like that, but the MVT only holds if the function is continuous and differentiable in the domain, which is the objective anyways. Am I allowed to use slope of the function in the arguments? – InMyOwn Euclidean space Nov 30 '17 at 22:55

So you want to further show that it is not uniform? Assume it were, then there exists some $\delta>0$ such that for every $x,y$ with $|x-y|<\delta$, we have $|x\sin x-y\sin y|<1$. Now take $x_{n}=2n\pi+\eta$, $y_{n}=2n\pi$, $n=1,2,...$ where $\eta>0$ is so small that $\eta<\min\{\delta,\pi/2\}$, then $|x_{n}-y_{n}|<\delta$ but $|x_{n}\sin x_{n}-y_{n}\sin y_{n}|=x_{n}\sin x_{n}\geq x_{n}\left(\dfrac{2}{\pi}(x_{n}-2n\pi)\right)\geq 2n\pi\cdot\dfrac{2}{\pi}\eta=4n\eta$. So we have $4n\eta<1$ for all $n=1,2,...$, this is a contradiction.

Note that we have the inequality $\sin x\geq\dfrac{2}{\pi}x$ for $x\in[0,\pi/2]$.

• That was nice way of disproving the uniform continuity. thanks! – InMyOwn Euclidean space Nov 30 '17 at 19:42