In the book "General topology" of Lipschutz, exercise 26 at page 222 says that: if $(f_n)$ be a sequence of real value differentiable funtions on $[a, b]$ which converge uniformly to $g$ then $$\lim_{n\to \infty} \frac{d}{dx}f_n(x)= \frac{d}{dx}\lim_{n\to \infty}f_n(x).$$ But I find that the sequence $$f_n(x)=\frac{1}{n}\cos(nx), \ \ x\in [0, 1]$$ satisfying $f_n$ converge uniformly to $g(x)\equiv 0$ but $\frac{d}{dx}f_n(x)=-\sin(nx)$ diverges as $n \to \infty$. This is a contradiction!
What explanations could you give me to know this?