Everywhere differentiable function whose derivative is not locally integrable My question is all in the title: I can’t come up with an example of a function $u \colon \mathbb R \to \mathbb R$ such that

*

*$u$ is differentiable at every $x \in \mathbb R$

*$u’ \notin L^1_{\text{loc}}(\mathbb R)$
Any ideas?
 A: To combine all the ideas from the comments, define $$f(x)=\begin{cases} x^2\sin(\frac{1}{x^2}) & x\not=0 \\ 0 &x=0\end{cases}$$
Then it's easy to see $f(x)$ is differentiable everywhere, and whenever $x\not=0$, $$f'(x)=2x\sin(\frac{1}{x^2})+x^2\cos(\frac{1}{x^2})\frac{-2}{x^3}=2x\sin(\frac{1}{x^2})+\frac{-2\cos(\frac{1}{x^2})}{x}$$
Note that $2x\sin(\frac{1}{x^2})$ is continuous and hence locally integrable, it's sufficient to show $g(x):=\frac{\cos(\frac{1}{x^2})}{x}$ is not around $0$. It's clearly unbounded, but this is insufficient to conclude it's not locally integrable.
Indeed, in the inverval $\frac{1}{x^2}\in [2n\pi, 2n\pi + \frac{1}{3}\pi]$, we have $\frac{1}{x}\ge \sqrt{2n\pi}\gg\sqrt{n}$, and $\cos(\frac{1}{x})\ge \frac{1}{2}\gg 1$. And the length of the interval is $$\frac{1}{\sqrt{2n\pi}}-\frac{1}{\sqrt{2n\pi + \frac{1}{3}\pi}}=\frac{\pi/3}{\sqrt{2n\pi + \frac{1}{3}\pi}\cdot\sqrt{2n\pi}\cdot(\sqrt{2n\pi + \frac{1}{3}\pi}+\sqrt{2n\pi})}\gg \frac{1}{n^{3/2}}$$
Hence $\int_0^\epsilon g^+(x)dx\gg\sum_{n=m(\epsilon)}^\infty \frac{1}{n}=\infty$.
