Means and Variances For a laboratory assignment, if the equipment is
working, the density function of the observed outcome
$X$ is
$$
f(x) = \begin{cases} 2(1-x), & 0 <x<1, \\
0, & \text{otherwise.} \end{cases}
$$
Find the variance and standard deviation of $X$.
We know that the variance is related to the mean and the second moment. I am stuck on how to set up the integrals for the both of them.

The integrals are
$$
\text{mean} = \mu = \int_0^1 x f(x) \, dx
$$
and
$$
\text{variance} = \sigma^2 = \int_0^1 (x-\mu)^2 f(x)\,dx.
$$
In order to evaluate the second integral, one must find $\mu$ by evaluating the first integral.
The second integral is the variance $\sigma^2$; the standard deviation is the square root of that.
