Example 6. Find the variance of a random variable $X$ that has a uniform distribution on the interval $[\alpha, \beta]$.
Solution. Using formula (2.5.15) and taking into account formulas (3.4.3) and (3.4.7), we find 204

$$
\begin{aligned}
D(X) & =\int_{-\infty}^{+\infty}(x-a)^{2} p(x) d x=\int_{-\infty}^{\alpha}(x-a)^{2} p(x) d x+\int_{\alpha}^{\beta}(x-a)^{2} p(x) d x+ \\
& +\int_{\beta}^{+\infty}(x-a)^{2} p(x) d x=\int_{\alpha}^{\beta} \frac{(x-a)^{2}}{\beta-\alpha} d x=\left.\frac{1}{\beta-\alpha} \cdot \frac{(x-a)^{3}}{3}\right|_{\alpha} ^{\beta}= \\
& =\left.\frac{\left(x-\frac{\alpha+\beta}{2}\right)^{3}}{3(\beta-\alpha)}\right|_{\alpha} ^{\beta}=\frac{\left(\beta-\frac{\alpha+\beta}{2}\right)^{3}-\left(\alpha-\frac{\alpha+\beta}{2}\right)^{3}}{3(\beta-\alpha)}=\frac{(\beta-\alpha)^{2}}{12}
\end{aligned}
$$

Thus,

$$
D(X)=\frac{(\beta-\alpha)^{2}}{12}
$$