How Do We Find the Expectation and Variance for a Continuous Random Variable?
If $X$ is discrete, we find its expectation with the following formula:
$$\mathbb{E}(X) = \sum_{\forall x} \ x \ \mathbb{P}(X=x)$$
However, if $X$ is continuous, this won’t work; there are too many values to add up, and in any case $\mathbb{P}(X=x)$ is always $0$.
Instead of a sum that is weighted by the PMF, we instead do an integral that is weighted by the PDF:
$$\mathbb{E}(X) = \int_{-\infty}^{\infty} \ x \ f_X(x) \ dx $$
We can immediately ignore any parts of the integral where $f_X(x)=0$.
The variance of $X$ is defined in the same way as the discrete case:
$$ \mathbb{V}\text{ar}(X) = \mathbb{E}(X^2) - \left( \mathbb{E}(X) \right)^2 $$
However, we now have:
$$\mathbb{E}(X^2) = \int_{-\infty}^{\infty} \ x^2 \ f_X(x) \ dx $$
Note that the only change was to replace $x$ with $x^2$ in the previous integral. In fact, we can find the expected value of any function $g(X)$ of $X$ in this same way.
As before, the standard deviation of a continuous random variable is just $\sqrt{\mathbb{V}\text{ar}(X)} $.