Variance of Continuous Random Variables

Compute the variance of a continuous random variable using the integral definition and the computational formula Var(X)=E[X2]μ2\text{Var}(X) = E[X^2] - \mu^2, and apply the linear-transformation rule Var(aX+b)=a2Var(X)\text{Var}(aX+b) = a^2\,\text{Var}(X).

Step 1 of 119%

Tutorial

Variance of a Continuous Random Variable

Recall that for a discrete random variable XX with mean μ=E[X]\mu = E[X], the variance is defined as Var(X)=E[(Xμ)2]\text{Var}(X) = E[(X-\mu)^2]. The same definition applies when XX is continuous with probability density function f(x)f(x); expectations are simply computed by integration:

Var(X)=E[(Xμ)2]=(xμ)2f(x)dx.\text{Var}(X) = E[(X-\mu)^2] = \int_{-\infty}^{\infty} (x-\mu)^2\, f(x)\,dx.

Expanding (Xμ)2(X-\mu)^2 and using linearity of expectation yields the computational formula

Var(X)=E[X2]μ2,\text{Var}(X) = E[X^2] - \mu^2,

which is almost always easier to evaluate than the definition directly. The two ingredients are the first and second moments

μ=E[X]=xf(x)dx,E[X2]=x2f(x)dx.\mu = E[X] = \int_{-\infty}^{\infty} x\, f(x)\,dx, \qquad E[X^2] = \int_{-\infty}^{\infty} x^2\, f(x)\,dx.

Example. Let XX have density f(x)=13f(x) = \dfrac{1}{3} on [0,3][0,3] (and 00 elsewhere). Then

μ=03x13dx=1392=32,E[X2]=03x213dx=13273=3.\begin{align*} \mu &= \int_0^3 x \cdot \tfrac{1}{3}\,dx = \tfrac{1}{3} \cdot \tfrac{9}{2} = \tfrac{3}{2}, \\[3pt] E[X^2] &= \int_0^3 x^2 \cdot \tfrac{1}{3}\,dx = \tfrac{1}{3} \cdot \tfrac{27}{3} = 3. \end{align*}

Therefore

Var(X)=E[X2]μ2=394=34.\text{Var}(X) = E[X^2] - \mu^2 = 3 - \tfrac{9}{4} = \tfrac{3}{4}.
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle