# What is the mean and variance of a random variable with the following probability density function?: f(x) = 3x^2 if -1 < x < 1; 0 otherwise

Nov 3, 2015

Mean $E \left(X\right) = 0$ and variance $\text{Var} \left(X\right) = \frac{6}{5}$.

#### Explanation:

Note that

$E \left(X\right) = {\int}_{-} {1}^{1} x \cdot \left(3 {x}^{2}\right) \text{ } \mathrm{dx}$
$= {\int}_{-} {1}^{1} 3 {x}^{3} \text{ } \mathrm{dx}$
$= 3 \cdot {\left[{x}^{4} / 4\right]}_{\text{(" - 1, 1 ")}}$
$= 0$

Also note that

$\text{Var} \left(x\right) = E \left({X}^{2}\right) - {\left(E \left(X\right)\right)}^{2}$
$= 3 \cdot {\left[{x}^{5} / 5\right]}_{\text{("- 1, 1")}} - {0}^{2}$
$= \frac{3}{5} \cdot \left(1 + 1\right)$
$= \frac{6}{5}$