Let $$ f(x) = \begin{cases} \frac{\sin x}{x} & x \neq 0 \\ 1 & x = 0 \end{cases} $$ Show that $f\in H^1(\mathbb{R}).$
My attempt:
$$f'(x)=\frac{x\cos x-\sin x}{x^2}$$ $$||f'(x)||_{L^2(\mathbb{R})}^2=\int_{\mathbb{R}}\frac{x^2\cos x-x\sin 2x+\sin^2x}{x^4}dx.$$
However, the following limit $$\lim_{x\to0^+}\frac{\cos x}{x^2}=\infty$$ prevents me from saying the $L^2$ norm of $f'$ exists. Am I looking at this the wrong way?
It's easier to see if you write the derivative as $$ f'(x) = \frac{1}{x}\left(\cos{x}-\frac{\sin{x}}{x}\right). $$ It is easy to see that the second factor is bounded by $2$, for example, and $f'(x)$ at $x=0$ (since $f(x)=1-x^2/6+\dotsb$ near zero). Then the integral of $f'^2$ is bounded by $2\int_1^{\infty} 4dx/x^2 + $ a constant to deal with the finite integral over $[-1,1]$.
Alternatively, one could use the Fourier transform definition, since $\hat{f}$ is constant on some interval $[-a,a]$ (depending only on the Fourier transform convention) and zero elsewhere, and hence $\int_{\mathbb{R}} (1+k^2) \lvert \hat{f}(k) \rvert^2 \, dk < \infty $.