# Proving continuity and differentiability of a function

let $f(x)=\sin |x|, x\in (-\pi,\pi)$. Is $f$ continuous on $(-\pi,\pi)$ ? Is it differentiable in that interval ?

I have read continuity at a point. How do i prove it for an interval ?

• It is continuous on a set if it is continuous for all points on the set. That is the definition of continuity of a function on a set. – Git Gud Oct 5 '13 at 17:24
• @GitGud yeah, so say if i consider a point in the given interval say $c$ how do i extend it ? can i just say that $sin x$ is obviously continuous everywhere in the given interval ? – Aman Mittal Oct 5 '13 at 17:28
• You haven't told us what you are allowed to assume. You have not even told us what definition you are using for the sine function. – dfeuer Oct 5 '13 at 17:32
• What do you mean with 'extend it'? Even though $\sin$ is continuous, that's not enough to guarantee that $x\mapsto \sin (|x|)$ is. – Git Gud Oct 5 '13 at 17:32
• @GitGud by extend i meant that if i show that at $c$ it is continuous how do i show that this is true for every point ? I understand that second point. I tried breaking the function for the intervals $(-\pi,0) \ and (0,\pi)$ but was stuck at how to actually show that it holds good at every point. Is it workable this way ? – Aman Mittal Oct 5 '13 at 17:41

Hint on continuity: $f$ is the composition of two functions, absolute value and sine. What do you know about continuity and composition?

Hint on differentiability: What point in $(-\pi,\pi)$ is a little weird for the absolute value function? How does that affect the sine function there?

Calculate $$\lim_{h\to0^+}\frac{f(h)-f(0)}h\quad\text{and}\quad \lim_{h\to 0^-}\frac{f(h)-f(0)}{h}.$$

• ok i get the continuity point. for differentiability, the absolute function fails at $0$, can your explain a little more on how that affects diff of the given function ? – Aman Mittal Oct 5 '13 at 17:45
• @AmanMittal: I added another hint. – dfeuer Oct 5 '13 at 18:01
• hmm okie, i get a $-1$ and a $+1$ , as they are different, the function must not be differentiable. is that rirght ? – Aman Mittal Oct 5 '13 at 18:19
• Well, you should get $1$ and $-1$, and that is why it's not differentiable, but you have to explain how you get those, which takes a little more trickery! – dfeuer Oct 5 '13 at 18:23
• yeah, by putting for negative and positive values for $|x|$ right ? – Aman Mittal Oct 5 '13 at 18:25

for checking differentiability of $f(x)=\sin |x|$ in the interval $(-\pi,\pi)$ :

The only doubtful point for differentiability of the function in the given point is $(0,0)$. If the function is diff there, $Rf'(0)=Lf'(0)$

$$Rf'(0)=\lim_{h\rightarrow 0} {f(0+h)-f(0)\over h}=\lim_{h\rightarrow 0}{sin h-0\over h}=1$$

$$LRf'(0)=\lim_{h\rightarrow 0} {f(0-h)-f(0)\over -h}=\lim_{h\rightarrow 0}{-sin(-h)-0\over -h}=-1$$

As $Rf'(0)\ne Lf'(0)$ The given function is not differentiable every point in the interval. Hence it is not differentiable in the interval.

• Not quite? Swapping the signs for $h$ in the intermediate form doesn't help you any, and you need to be more explicit about the left/right distinction. – dfeuer Oct 5 '13 at 19:02