Proof that variance is always greater than or equal to zero

It is common knowledge that: $$$$\label{3} Var(X) \geq 0$$$$ for every random variable $$X$$. Despite this, I do not remember seeing a formal proof of this.

Is there a proof of the above inequality? What if we include the realm of complex numbers, does this open up the possibility to the above inequality being wrong?

• The variance is the expectation of a squared quantity. The meaning of "$\lt$" and related relations are defined in mathematics by declaring all squares to be non-negative. Do you therefore need any proof? For another approach in which it is obvious variances are non-negative, see stats.stackexchange.com/a/18200/919 (where variances are expressed as areas). For complex numbers nothing changes: the definition of complex variance is arranged to agree with the definition for real numbers and to always be non-negative.
– whuber
May 25, 2021 at 19:40
• This can also be seen from Cauchy-Schwarz inequality. May 26, 2021 at 8:39
• It's simple to reason that if rv can have more than one value than inequality holds true, otherwise it's 0 May 26, 2021 at 14:03

Go to your definition of variance:

$$\operatorname{Var}(X) = \int(x-\mu)^2f(x)\,dx$$

The $$(x-\mu)^2$$ component is non-negative, and the $$f(x)$$ component is non-negative, so the integrand, $$(x-\mu)^2f(x)$$ is non-negative.

When you integrate an integrand that is always at the x-axis or above, the area under that curve will be non-negative.

This might be a bit easier to see if the variance is written as a sum (for a discrete variable):

$$\operatorname{Var}(X) = \sum_i p(x_i)(x_i -\mu)^2$$

As before, $$p(x_i)\ge 0$$ for all $$x_i$$, and $$(x_i - \mu)^2\ge 0$$ for all $$x_i$$, so that is a sum of non-negative values.

• If you really wanted to be formal and prove the integral inequality, it can be proved from the fundamental theorem of calculus.
– qwr
May 26, 2021 at 6:26
• @qwr That is overkill, the inequality follows directly by the definition of the integral (limit of sums which are non-negative). The FTC only applies when one has a continuous density function. May 26, 2021 at 9:47
• @Dave, typo in final line, the square of difference from mean is positive. May 26, 2021 at 19:14
• I keep seeing people saying that an integral such as the one here is the DEFINITION of variance or of expected value. But this is a theorem, not a definition. One can say $$\operatorname E(X) = \int_\Omega X(\omega) P(d\omega) = \int_{\mathbb R} xf_X(x)\,dx$$ and the first equality, not the second, is the definition. Look at this: $\cdots \qquad$ May 26, 2021 at 22:23
• @microhaus It isn’t that one is right and the other is wrong. It has to do with something called the law of the unconscious statistician. The equation in terms of its expected value is the true definition of the second central moment. However, since it can be shown to be equal to what I wrote, pretty much everyone treats my equation as a definition.
– Dave
May 27, 2021 at 0:03

As for your question regarding complex numbers, the variance is defined as being the expectation of the absolute value, or modulus, squared of the deviation from the mean. If the absolute value is not taken, that is referred to as the "pseudo variance".