How to argue that variance integral actually converges? I'm just starting out with a course where were being taught about expectation and variance of continuous distributions via probability density functions. I was given a definition of how the variance of a random variable $X$ is calculated given its probability density function $f(x)$, but the definition seems all to suspicious to me. In particular, if $X$ is a random variable and its PDF is $f(x)$, then it's variance is computed via
$$
\text{Var}(X) = \int _{\mathbb{R}}x^2 f(x) \, dx
$$
where I've assumed the expected value of $X$ is $0$ just to make things a bit simpler.
Now, since $f(x)$ is assumed to be a PDF, then you'd expect
$$
\int _{\mathbb{R}}f(x) \,dx = 1
$$
which seems to hint that the function is (sort of) integrable. But, how can you even make sure that integration of $x^2 f(x)$ actually yields a finite value? I've tried a back-of-the-envelope calculation using integration by parts, and the situation seems to hinge on whether or not $x^2 f(x) \rightarrow 0$ as $|x| \rightarrow 0$, yet I can't find how this is justified. Any and all help will be appreciated :)
 A: The integral does not always converge, even if $\lim_{|x|\to\infty} x^2f(x)=0$. There are valid random variables which have an infinite variance: for instance, consider  a random variable with density
$$
f(x) = \frac{3\sqrt{3}}{4\pi}\cdot\frac{1}{1+|x|^3}, \qquad x\in\mathbb{R}.
$$
Worse, there even are valid random variables for which the expectation is not defined. A standard example is those following the Cauchy distribution, e.g., one with density function
$$
f(x) = \frac{1}{\pi}\cdot \frac{1}{1+x^2}, \qquad x \in\mathbb{R}.
$$
(You can check easily that $\int_{\mathbb{R}} f(x)dx = 1$, yet $\int_{\mathbb{R}} xf(x)dx$ does not exist.) A fortiori, the random variables without a well-defined expectation do not have a finite variance.

Some vocabulary: a random variable is in $L^1$ if its expectation exists. It is in $L^2$ if its variance exists. By the Cauchy—Schwarz inequality, $L^2\subseteq L^1$.

Finally, you can even find density functions  $f$ (hence, random variables) such that
$$
\lim_{|x|\to\infty} x^2f(x)=0
$$
yet which don't have a well-defined expectation (not in $L^1$). An example is
$$
f(x) = \frac{1}{C}\cdot\frac{1}{1+x^2\log(1+x^2)}, \qquad x\in\mathbb{R}
$$
where $C = \int_{\mathbb{R}}\frac{1}{1+x^2\log(1+x^2)} \approx 1.36$.
