X random variable with exponential distribution, calc variance X for some exersice i try to calc VX. X is a random variable with exponential distribution and density $f(x)=e^{-x}$ for $x\ge 0$. So i calculated the expectation value which is EX = 1 (right?).
So with this value i want to use
$$VX=EX^2 -(EX)^2$$ So i need only to calculate $EX^2$.
My approach:
$$ EX^2 = \int_{0}^\infty x^2 e^{-x} dx $$
So now i have problems to integrate this. 
The next question is how to calc $P(X\ge a | X \ge 1)$ $ a \in$ real numbers. 
 A: You can use the moment generating function for the exponential distribution. The moment generating function for this is the $E(e^{tx})$ $$ E(e^{tx}) = \int_{0}^\infty e^{(t-1)x} dx $$
Now differentiate this function and put t=0 to get $E(X)$ and differentiate it twice and put t=0 to get $E(X^2)$. And then calculate the $V(X)$.
$$E(e^{tx})=\frac{1}{1-t}$$
Now differentiate it once to evaluate
$$E'(e^{tx})=\frac{1}{(1-t)^2}\Rightarrow E'(e^{tx}) \text{at t=0 is}=1 $$
Implying the $E(X)=1$
Again,
$$E''(e^{tx})=\frac{2}{(1-t)^3}$$
Again this one at t=0 gives the value of$$E(X^2)=2$$
After all the calculation the variance evaluates to be $2-1=1$.In this problem I have used the fact the nth derivative of a generating function at the point 0 gives the expection of the random variable raised to the power n.
$$E(e^{tx})=E(\sum_{i=0}^{\infty}\frac{(tx)^i}{i!})=\frac{t^i}{i!}\sum_{i=0}^{\infty}(E(X^i))$$
$$ $$(Using the linearity of expectation.)Now by differentiating this we get the things done above.
A: To find $E(X^2)$, integrate by parts twice. Each time differentiate the power of $x$ and it will whittle away.  Begin with $u = x^2$, $dv = e^{-x}\, dx$.
