Example 10. The random variable $X$ is given by the distribution function

$$
F(x)= \begin{cases}0 & \text { if } x \leq 0 \\ \frac{(1-\cos x)}{2} & \text { if } 0 < x \leq \pi\end{cases}
$$

Find the probability density function of the random variable $X$. Calculate the probability that the random variable $X$ will take values from the interval $(\pi / 3, \pi / 2)$.
Solution. The probability density $p(\bar{x})$ and the distribution function $F(x)$ of a random variable $X$ are related by (2.3.5), i.e., $F^{\prime}(x)=p(x)$. Therefore,

$$
p(x)=0 \text { for } x=0 \text { and } x>\pi, p(x)=\left(\frac{1-\cos x}{2}\right)^{\prime}=\frac{\sin x}{2}
$$

in the interval $(0, \pi)$. Using formula $(2.3 .3)$, we find the desired probability

$$
P\left(\frac{\pi}{3}<X<\frac{\pi}{2}\right)=\int_{\pi / 3}^{\pi / 2} \frac{\sin x}{2} d x=-\left.\frac{1}{2} \cos x\right|_{\pi / 3} ^{\pi / 2}=-\frac{1}{2}\left(\cos \frac{\pi}{2}-\cos \frac{\pi}{3}\right)=\frac{1}{4}
$$