# Math Help - Probability and variance

1. ## Probability and variance

I don't understand what I missed that I got wrong variance:

2. Originally Posted by totalnewbie
I don't understand what I missed that I got wrong variance:
Theorem: $Var(aU + b) = a^2 Var(U)$.

In your case $a = \cos t$ and $b = 0$.

Alternatively:

$E(X) = \int_a^b \frac{u \cos t}{b-a} \, du = \frac{a + b}{2} \, \cos t$.

$E(X^2) = \int_a^b \frac{u^2 \cos^2 t}{b-a} \, du = \frac{a^2 + ab + b^2}{3} \, \cos^2 t$.

Note: $\frac{b^3 - a^3}{b-a} = \frac{(b-a)(b^2 + ab + a^2)}{b-a} = b^2 + ab + b^2$.

$Var(X) = E(X^2) - [E(X)]^2 = \frac{a^2 + ab + b^2}{3} \, \cos^2 t - \frac{(a + b)^2}{4} \, \cos^2 t = \frac{(b-a)^2}{12} \, \cos^2 t$.