Let $f(x)=\frac{\sin x}{x}$ if $x\neq 0$ and $f(x)=0$ if $x=0$. Is $f$ Lebesgue integrable? Also, is $\sin^2x/x^2$ Lebesgue integrable?
Note that $\lim_{x\to 0}\frac{\sin x}{x}=1=f(0)$. So $f$ is measurable. We have $$ \int_\mathbb{R} |f(x)|dx=2\int_0^\infty f(x)dx $$
My question is that I saw one approach: $$ \int_\mathbb{R} |f(x)|dx\ge \int_{[0,\infty)} |f(x)|dx\ge \int_{\cup_{n\ge 1}[2n\pi, 2n\pi+\pi]} |f(x)|dx=\sum_{n=0}^\infty \int_{[2n\pi, 2n\pi+\pi]} |f(x)|dx $$ $$ \ge \sum_{n=0}^\infty \int_{[2n\pi, 2n\pi+\pi]} \frac{|\sin x|}{2\pi(n+1)}=\infty $$ So $f$ is not Lebesgue integrable.
However, in this answer: $\int_{0}^{\infty}\frac{\sin x}{x}dx $ converges, we know that $$ \int_0^\infty f(x)dx=\pi/2 $$
So why do we get two different answers?
To find $\int_\mathbb{R} \sin^2x/x^2dx$, I repeat the above argument: $$ \int_\mathbb{R} \sin^2x/x^2dx=2\int_{[0,\infty)}\sin^2x/x^2dx=\int_{\cup_{n\ge 1}[2n\pi, 2n\pi+\pi]}\sin^2x/x^2dx=\sum_{n=0}^\infty \int_{[2n\pi, 2n\pi+\pi]} \frac{|\sin^2 x|}{x^2}dx $$ $$ \le \sum_{n=0}^\infty \int_{[2n\pi, 2n\pi+\pi]} \frac{|\sin^2 x|}{(2n\pi)^2}dx<\infty $$