How to compute the variance for the random variable Y that has the triangle distribution:
$$f_Y(x) = \begin{cases} 4x,\;0\leq x\ \leq \frac12 \\ 2-4x, \; \frac12 \leq x \leq 1 \end{cases} \quad$$ The answer should be $\frac{1}{24}$ but I don't know how to get this. This is what I have done: $$\mu_Y = \int_{\frac12}^{0} 4x\cdot x \,dx +\int_{1}^{\frac12} (2-4x)\cdot x \,dx = -0.25$$ $$\text{Var}(Y) = E(Y^2) - \mu_Y^2 = \int_{\frac12}^{0} 4x\cdot (x+0.25)^2 \,dx +\int_{1}^{\frac12} (2-4x)\cdot (x+0.25)^2 \,dx$$ I could not get the correct answer and did not have a clear idea what I've done incorrectly. Any help will be appraciated.