Let $f: \mathbb{R}-\{0\} \rightarrow \mathbb{R}, f(x)=\left| \cos(\frac{1}{x}) \right|$ Why is f not differentiable in $\frac{2}{\pi}$? Let $f: \mathbb{R}-\{0\} \rightarrow \mathbb{R}, f(x)=\left|\cos(\frac{1}{x}) \right|$ Why is f not differentiable in $\frac{2}{\pi}$?
If we take the difference quotient: $$\lim_{h \rightarrow 0}\frac{\left| \cos(\frac{\pi}{2+ \pi h}) \right| - \left|cos(\frac{\pi}{2})\right|}{h}$$
Why does the limit not exist at $\pi /2$?
 A: It's the absolute value sign that makes it nondifferentiable at ${2 \over \pi}$. The function
$\cos({1 \over x})$ is equal to zero at $x = {2 \over \pi}$, is positive to the left of $x = {2 \over \pi}$, and is negative to the right of $x = {2 \over \pi}$. 
Thus to the left of $x = {2 \over \pi}$, you have $|\cos({1 \over x})| = \cos({1 \over x})$, while to the right of $x = {2 \over \pi}$, you have $|\cos({1 \over x})| = -\cos({1 \over x})$. 
So the left-hand derivative of $|\cos({1 \over x})|$ will be given by ${d \over dx} \cos({1 \over x})\big|_{x = {2 \over \pi}} = {1 \over x^2}\sin({1 \over x})\big|_{x = {2 \over \pi}} = {\pi^2 \over 4}$. On the other hand, the the right-hand derivative of $|\cos({1 \over x})|$ will be given by ${d \over dx} (-\cos({1 \over x}))\big|_{x = {2 \over \pi}} = -{1 \over x^2}\sin({1 \over x})\big|_{x = {2 \over \pi}} = -{\pi^2 \over 4}.$ Since these are not the same, the function is not differentiable at ${2 \over \pi}$. 
A: Actually, $f(x+h) = \cos\left(\frac{1}{\frac{\pi}{2}+h}\right)$. So you should try to evaluate: $$\lim_{h \to o} \frac{\cos\left(\frac{1}{\frac{\pi}{2}+h}\right) - \cos \left(\frac{1}{\frac{\pi}{2}}\right)}{h} = \lim_{h \to 0} \frac{\cos\left(\frac{2}{\pi + 2h}\right) - \cos\left(\frac{2}{\pi}\right)}{h}$$
However, this is not necessary because $1/x$ is differentiable in $\pi/2$ and $\cos x$ is differentiable in $2/\pi$. This way, $f'(x) = \frac{1}{x^2}\sin(1/x)$, and $f'(\pi/2) = \frac{4}{\pi^2}\sin(2/\pi)$.
