271. The density function of a continuous random variable $X$ is given on the entire $O x$ axis by the equation $f(x)=$ $=4 C /\left(\mathrm{e}^{x}+\mathrm{e}^{-x}\right)$. Find the constant parameter $C$.
Solution. The density function $f(x)$ must satisfy the condition $\int_{-\infty}^{\infty} f(x) \mathrm{d} x=1$. We require that this condition be satisfied for the given function:

$$
4 C \int_{-\infty}^{\infty} \frac{\mathrm{d} x}{\mathrm{e}^{x}+\mathrm{e}^{-x}}=1
$$

From this,

$$
C=1 /\left(4 \int_{-\infty}^{\infty} \frac{\mathrm{d} x}{\mathrm{e}^{x}+\mathrm{e}^{-x}}\right)
$$

First, we find the indefinite integral:

$$
\int \frac{d x}{e^{x}+e^{-x}}=\int \frac{e^{x} \mathrm{~d} x}{1+\mathrm{e}^{2 x}}=\operatorname{arctg} \mathrm{e}^{x}
$$

Then we compute the improper integral:

$$
\begin{gathered}
\int_{-\infty}^{\infty} \frac{\mathrm{d} x}{\mathrm{e}^{x}+\mathrm{e}^{-x}}=\lim _{a \rightarrow-\infty} \int_{a}^{0} \frac{\mathrm{d} x}{\mathrm{e}^{x}+\mathrm{e}^{-x}}+\lim _{b \rightarrow \infty} \int_{0}^{b} \frac{\mathrm{d} x}{\mathrm{e}^{x}+\mathrm{e}^{-x}}= \\
=\left.\lim _{a \rightarrow-\infty} \operatorname{arctg} \mathrm{e}^{x}\right|_{a} ^{0}+\left.\lim _{b \rightarrow \infty} \operatorname{arctg} \mathrm{e}^{x}\right|_{0} ^{b}= \\
=\lim _{a \rightarrow-\infty}\left[\operatorname{arctg} 1-\operatorname{arctg} \mathrm{e}^{a}\right]+\lim _{b \rightarrow \infty}\left[\operatorname{arctg} \mathrm{e}^{b}-\operatorname{arctg} 1\right]=\pi / 2
\end{gathered}
$$

Thus,

$$
\int_{-\infty}^{\infty} \frac{\mathrm{dx}}{\mathrm{e}^{x}+\mathrm{e}^{-x}}=\frac{\pi}{2}
$$

Substituting (**) into (*), we finally get $C=1 / 2 \pi$.