Term by term differentiation sum and criterion for differentiability for $f(x) =\sum_{1}^{\infty} 2^{-n} |x-1/n|$ Let $f(x) =\sum_{1}^{\infty} 2^{-n} |x-1/n|$

*

*Compute $f'(x)$ for $x \in (1,\infty), (1/2,1)$

*Prove that $f$ is not differentiable at $x=1$
For part 1 I have that since $f_n$ is differentiable at each $x\in \{1,1/2,1/3,...\}^c$ and $f$ converges for all $\mathbb{R}$ and $\sum f'_n(x)$ converges uniformly then by term by term differentiablity theorem $f'(x) = \sum f'_n(x).$
To find the sum. I'm a little unsure about this part since i got one of them to sum to 0:

*

*If $x \in (1, \infty)$ then $x> 1/n, \forall n \in \mathbb{N}.$ Thus $f'_n(x) = 2^{-n}$ for all $n,$ which implies $f'(x) = \sum f'_n(x) = \sum_{n=1}^{\infty} 1/2^n$ which is geometric thus sum equals $\frac{1/2}{1-1/2} =1$


*If $x \in (1/2, 1)$ then $x<1/n$ only for $n=1$. Thus $f'_1(x) = -2^{-1}$ and $f'_n(x) = 2^{-n}$ for $n>1.$Thus $$f'(x) = \sum_{n=1}^{\infty} f'_n(x) = -2^{-1} + \sum_{n=2}^{\infty}1/2^n = -1/2 +1/2 =0.$$Is this right?
For part 2 I'm sort of stuck. How do i show $f$ is not differentiable at $x=1$? I know that due to $|x-1/n|, f_n$ is not differentiable at $1/n, \forall n \in \mathbb{N}$. Namely $f_1$ is not differentiable at 1. So the term by term differentiability theorem fails here. But I don't think that this failing here implies $f$ is not differentiable here?
How would you show $f$ is not differentiable at $x=1$?
 A: First compute $f(1) = \sum_{n=1}^{\infty}\frac1{2^n}(1-\frac1{n}) = \sum_{n=1}^{\infty}\frac1{2^n}-\sum_{n=1}^{\infty}\frac1{n2^n} = 1-\ln(2)$
because $\sum_{n=1}^{\infty}\frac{x^n}{n} = -\ln(1-x)$ for $|x| < 1$ (in particular the sum follows with $x=\frac1{2}$).
Then notice that since you already know that $f'(x) = 0$ in $(1/2, 1)$ it follows that $f$ must be constant, because $f$ is continuous in $[1/2, 1]$, as the series is uniformly convergent (in this interval) and each term is continuous. Thus $f(x) = 1-\ln(2)$ for all $x$ in $[1/2, 1]$.
It follows that the left-derivative at $x=1$ is $0$. It remains to see what the right-derivative is. For $x > 1$ the sum is $x-\ln(2)$ (the computation is just as above for $f(1)$). Thus: $$f'_+(1) = \lim_{h\to0+}\frac{f(1+h)-f(1)}{h} = \lim_{h\to0+}\frac{(1+h-\ln(2))-(1-\ln(2))}{h} = \lim_{h\to0+}1 = 1$$
This shows that $f$ is not differentiable at $x=1$, since $f'_+(1) = 1 \ne f'_-(1) = 0$.
You can also show that $f$ is constant in $[1/2, 1]$ by directly computing the sum: you will notice that the $x$'s cancel out.
A: You have correctly found $f'(x)=1$ for $x>1$ and $f'(x)=0$ for $x<1/2.$ Furthermore, since the series defining $f$ converges uniformly on $(0,2),$ $f$ is continuous on $(0,2).$ In particular, $f$ is continuous at $1.$
Suppose $x>1.$ Then by the MVT, there exists $c_x\in (1,x)$ such that
$$\frac{f(x)-f(1)}{x-1}= f'(c_x) = 1.$$
Note we needed the continuity of $f$ at $1$ to invoke MVT. Similarly, if $x\in (1/2,1),$ then
$$\frac{f(x)-f(1)}{x-1}= f'(c_x) = 0.$$
Thus the difference quotient has limit $1$ from the right and limit $0$ from the left. It follows that $f'(1)$ does not exist.
