752. Output the formula

$$
I_{i}^{*}=\frac{b-a}{n} \sum_{i=1}^{n}\left[\varphi\left(x_{i}\right)-g\left(x_{i}\right)\right]+\int_{a}^{b} g(x) \mathrm{d} x
$$

where $x_{i}=a+(b-a) r_{i}, g(x) \simeq \varphi(x)$, for estimating the integral

$$
I=\int_{a}^{b} \varphi(x) \mathrm{d} x
$$
Solution. Let us consider a random variable $\boldsymbol{X}$, uniformly distributed over the integration interval $(a, b)$ with density $f(x)=1/(b-a)$.

Suppose we have found a function $g(x)$ that is "close" to $\varphi(x)$ and whose integral can be computed without resorting to the Monte Carlo method. Then the mathematical expectation of the function

$$
F(X)=(b-a)[\varphi(X)-g(X)]+\int_{a}^{b} g(x) d x
$$

is equal to 1.

Indeed, taking into account that the variable $X$ is uniformly distributed over the integration interval $(a, b)$ with density $1/(b-a)$, we obtain

$$
\begin{aligned}
M[F(X)]=(b-a) \int_{a}^{b}[ & \varphi(x)-g(x)] \cdot \frac{1}{(b-a)} \cdot d x+\int_{a}^{b} g(x) \mathrm{d} x= \\
& =\int_{a}^{b} \varphi(x) \mathrm{d} x=1
\end{aligned}
$$

Thus, as an estimate of the mathematical expectation $\boldsymbol{M}[F(X)]$, and therefore of the integral $I$, we can take the arithmetic mean of $n$ values of the function $F(X)$:

$$
I_{i}^{*}=\frac{b-a}{n} \sum_{i=1}^{n}\left[\varphi\left(x_{i}\right)-g\left(x_{i}\right)\right]+\int_{a}^{b} g(x) d x
$$

where $x_{i}$ are possible values of $X$, which are generated by the formula

$$
x_{i}=a+(b-a) r_{i}.
$$