# Help to see if this function is diffentiable

1. May 6, 2006

### mohlam12

Hello,
I need some help to see if this function is diffentiable at $$x_{0}=\frac{\pi}{4}$$
the function is f(x)=|sin(x)-cos(x)|
To do that, you have to find the limit of $$\frac{f(x)-f(x_{0})}{x-x_{0}}$$ as x-> pi/4
So I get $$\frac{sin(x)-cos(x)}{x-\frac{\pi}{4}}$$but I don't know what to do after...any help or hints would be appreciated
Thanks

Last edited: May 6, 2006
2. May 6, 2006

### benorin

since sin(x) and cos(x) are equal at x=pi/4, we have

$$f(x) = | \sin (x)- \cos (x)| = \left\{\begin{array}{cc}\cos (x)-\sin (x) ,&\mbox{ if } 0\leq x\leq \frac{\pi}{4}\\ \sin (x)- \cos (x), & \mbox{ if } \frac{\pi}{4}\leq x \leq \pi\end{array}\right.$$

now compute the derivative using the formula

$$f^{\prime} (x_0) = \lim_{h\rightarrow 0} \frac{f(x_0+h) -f(x_0)}{h}$$

since f(x) is piecewise defined, use left- and right-handed limits to comput the above limit, here is the first one

$$f_{-}^{\prime} \left( \frac{\pi}{4}\right) = \lim_{h\rightarrow 0^{-}} \frac{\cos\left( \frac{\pi}{4}+h\right) -\sin\left( \frac{\pi}{4}+h\right) -0}{h} = \lim_{h\rightarrow 0^{-}} \frac{\cos\left( \frac{\pi}{4}\right) \cos (h) -\sin\left( \frac{\pi}{4}\right) \sin (h) - \sin\left( \frac{\pi}{4}\right) \cos(h)- \cos\left( \frac{\pi}{4}\right) \sin (h)}{h}$$
$$=\frac{\sqrt{2}}{2} \lim_{h\rightarrow 0^{-}} \frac{-2\sin (h)}{h} = -\sqrt{2}$$

now do the right-hand limit to finish-up.