Example 2. The probability density of a random variable $X$ is given by the function

$$
p(x)= \begin{cases}0 & \text { if } x \leq 0 \\ x / 2 & \text { if } 0 < x \leq 2\end{cases}
$$

Find the probability that in the experiment, the variable $X$ will take a value from the interval $(1,2)$.
Solution. The required probability will be found using formula (2.3.3):

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