Optimizing Monte Carl integral calculation with control variate

For an exercise I am asked to calculate an integral with a monte carlo simulation, after that I need to optimize the results with a control variate. This was the given integral:

$\int_0^1 \! \frac{\sin(1-x)}{\sqrt{x}} \, \mathrm{d}x.$

As far as I understand, this isn't that hard. Especially since this is an integral with domain [0,1]. I basically only need to generate a U(0,1) variable, insert this in the follwing formula and in the end take the average result as my solution.

$\frac{\sin(1-x)}{\sqrt{x}}$

However, I am now asked to introduce a control variate to optimize my result. In my understanding, a control variate is another stochastic variable of which the expected value is known. I don't know however what the criteria are when you are searching for a control variate.

For example: in the example of control variates of wikipedia they chose $g(x)=1+x$ as a control variate for $f(x)=\frac{1}{1+x}$. Is this a good control variate because it is a simplified version of the original integral?

• You just choose $g$ such that: 1) you can calculate the covariation of $f$ and $g$ (to get the optimal $c$-coefficient) 2) $E(g)$ is known. Everything else does not matter too much. – Phun Jan 17 '16 at 22:26