From the exercise and the example,
\(\begin{aligned}{l}g\left( x \right) = \frac{{{e^{ - x}}}}{{1 + {x^2}}},\,\,\,0 < x < 1,\\{f_3}\left( x \right) = \frac{{{e^{ - x}}}}{{1 - {e^{ - 1}}}},\,\,\,0 < x < 1.\end{aligned}\)
First, simulate\({X^{\left( i \right)}},\,\,i = 1,2,....,\nu \). To do that, use integral probability transformation. The cumulative density function is
\({F_3}\left( x \right) = \,\,\,\smallint _0^X\,\,\frac{{{e^{ - t}}}}{{1 - {e^{ - 1}}}}dt = \frac{{1 - {e^{ - x}}}}{{1 - {e^{ - 1}}}},\,\,\,\,\,\,\,0 < x < 1.\)
Let U be from the uniform distribution on the interval (0, 1). It follows that X values can be simulated using U as
\(X = - \log \left( {1 - U\left( {1 - {e^{ - 1}}} \right)} \right)\)
which is obtained from
\(U = \frac{{1 - {e^{ - x}}}}{{1 - {e^{ - 1}}}}.\)
The random variable T is
\({T^{\left( i \right)}} = {F^{ - 1}}\left( {1 - {U^{\left( i \right)}}} \right) = - \log \,\left( {1 - \left( {1 - {U^{\left( i \right)}}} \right)\,\,\left( {1 - {e^{ - 1}}} \right)} \right)\,\,,\,\,\,\,\,i = 1,2,...,\nu ,\)
Simulations of W and V are obtained as
\(\begin{aligned}{l}{W^{\left( i \right)}} &= \frac{{g\left( {{X^{\left( i \right)}}} \right)}}{{{f_3}\left( {{X^{\left( i \right)}}} \right)}} &= \frac{{1 - {e^{ - 1}}}}{{1 + {X^{\left( i \right)\,2}}}},\,\,\,\,\,i &= 1,2,...,\nu ,\\{V^{\left( i \right)}} &= \frac{{g\left( {{T^{\left( i \right)}}} \right)}}{{{f_3}\left( {{T^{\left( i \right)}}} \right)}} &= \frac{{1 - {e^{ - 1}}}}{{1 + {T^{\left( i \right)\,2}}}},\,\,\,\,\,i = 1,2,...,\nu ,\end{aligned}\)
Using those, simulations of Y are
\({Y^{\left( i \right)}} = 0.5\,\,.\,\,\left( {{W^{\left( i \right)}} + {V^{\left( i \right)}}} \right)\)
And the estimator
\(Z = \frac{1}{\nu }\sum\limits_{i = 1}^\nu {{Y^{\left( i \right)}}.} \)
Use the following code in R to estimate the integral. The estimate of the integral in the first simulation is 0.52466, and the simulation standard error is \(2.398\,\, \cdot \,\,{10^{ - 6}}\). The simulation standard deviation is smaller than in the example.