# Science:MATH105 Probability/Lesson 2 CRV/2.11 Alternate Variance Formula

An following formula for the variance of a continuous random variable is often less tedious than its definition.

Theorem: Alternate Formula for the Variance of a Continuous Random Variable
The variance of a continuous random variable X with PDF f(x) is a number given by

${\displaystyle {\text{Var}}(X)=\int _{-\infty }^{\infty }x^{2}f(x)dx-E(X)^{2}}$

## Simple Example

Use the alternate formula for variance to calculate the variance the PDF given in the last example, which was

${\displaystyle f(x)={\begin{cases}2(1-x)&{\text{if }}0\leq x\leq 1,\\0&{\text{else}}\end{cases}}}$

### Solution

Remembering that E(X) was found to be 1/3, we may compute the variance of X as follows

{\displaystyle {\begin{aligned}{\text{Var}}(X)&=\int _{-\infty }^{\infty }x^{2}f(x)dx-E(X)^{2}\\&=\int _{0}^{1}x^{2}{\big (}2(1-x){\big )}dx-{\frac {1}{9}}\\&=2\int _{0}^{1}{\big (}x^{2}-x^{3}{\big )}dx-{\frac {1}{9}}\\&=2{\big (}{\frac {1}{3}}x^{3}-{\frac {1}{4}}x^{4}{\big )}{\big |}_{0}^{1}-{\frac {1}{9}}\\&=2{\big (}{\frac {1}{3}}-{\frac {1}{4}}{\big )}-{\frac {1}{9}}\\&={\frac {1}{18}}\end{aligned}}}

## Discussion of This Example

### Do MATH 105 Students Have to Memorize The Alternate Formula for Variance?

No. MATH 105 students do not have to memorize the alternate formula. Students need to memorize the definition of variance, but can use the alternate formula if they like on an exam.