Example 3. The distribution function of a random variable $X$ is given by

$$
F(x)= \begin{cases}0 & \text { if } x \leq 0 \\ \frac{x^{2}}{1+x^{2}} & \text { if } x>0\end{cases}
$$

Find its probability density function.
Solution. The probability density function $p(x)$ and the distribution function $F(x)$ are related by equation (2.3.5).

According to equality (2.3.5), we find:

$$
\begin{gathered}
p(x)=F^{\prime}(x)=\left(\frac{x^{2}}{1+x^{2}}\right)^{\prime}=\frac{2 x\left(1+x^{2}\right)-2 x \cdot x^{2}}{\left(1+x^{2}\right)^{2}}=\frac{2 x}{\left(1+x^{2}\right)^{2}} \quad \text { for } x>0 ; \\
p(x)=F^{\prime}(x)=0 \quad \text { for } x \leq 0
\end{gathered}
$$

Thus, the probability density function of the given random variable is defined by the function

$$
p(x)= \begin{cases}0 & \text { for } x \leq 0 \\ \frac{2 x}{\left(1+x^{2}\right)^{2}} & \text { for } x>0\end{cases}
$$

Remark. This function satisfies conditions (2.3.4) and (2.3.6). Indeed,

$$
\int_{-\infty}^{+\infty} p(x) d x=\int_{-\infty}^{0} 0 d x+\int_{0}^{+\infty} \frac{2 x}{\left(1+x^{2}\right)^{2}}=0+\int_{0}^{+\infty} \frac{d\left(x^{2}+1\right)}{\left(1+x^{2}\right)^{2}}=-\left.\frac{1}{1+x^{2}}\right|_{0} ^{+\infty}=-(0-1)=1
$$

Example 4. Find the distribution function of the random variable $X$, the probability density of which is defined by the formula

$$
p(x)=\frac{1}{\pi\left(1+x^{2}\right)} \quad(-\infty<x<+\infty)
$$

Solution. Applying formula (2.3.2), we get

$$
\begin{aligned}
& F(x)=\int_{-\infty}^{x} \frac{d t}{\pi\left(1+t^{2}\right)}=\left.\frac{1}{\pi} \operatorname{arctg} t\right|_{-\infty} ^{x}=\frac{1}{\pi}[\operatorname{arctg} x-\operatorname{arctg}(-\infty)]= \\
& =\frac{1}{2}+\frac{1}{\pi} \operatorname{arctg} x
\end{aligned}
$$

Remark. The obtained function $F(x)$ satisfies conditions $(2.2 .7):$

$$
\begin{aligned}
& \lim _{x \rightarrow-\infty}\left(\frac{1}{2}+\frac{1}{\pi} \operatorname{arctg} x\right)=\frac{1}{2}+\frac{1}{\pi} \lim _{x \rightarrow-\infty} \operatorname{arctg} x=\frac{1}{2}+\frac{1}{\pi} \cdot\left(-\frac{\pi}{2}\right)=\frac{1}{2}-\frac{1}{2}=0 \\
& \lim _{x \rightarrow+\infty}\left(\frac{1}{2}+\frac{1}{\pi} \operatorname{arctg} x\right)=\frac{1}{2}+\frac{1}{\pi} \lim _{x \rightarrow+\infty} \operatorname{arctg} x=\frac{1}{2}+\frac{1}{\pi} \cdot\left(\frac{\pi}{2}\right)=\frac{1}{2}+\frac{1}{2}=1
\end{aligned}
$$