Importance Sampling, a simple example

Let us look again at the integral $$ I=\int_0^1 F(x) dx = \int_0^1 \frac{1}{1+x^2} dx = \frac{\pi}{4}. $$ We choose the following PDF (which follows closely the function to integrate) $$ p(x)=\frac{1}{3}\left(4-2x\right) \hspace{1cm} \int_0^1p(x)dx=1, $$ resulting in $$ \frac{F(0)}{p(0)}=\frac{F(1)}{p(1)}=\frac{3}{4}. $$ Check that it fullfils the requirements of a PDF! We perform then the change of variables (via the Cumulative function) $$ y(x)=\int_0^x p(x')dx'=\frac{1}{3}x\left(4-x\right), $$ or $$ x=2-\left(4-3y\right)^{1/2} $$ We have that when \( y=0 \) then \( x=0 \) and when \( y=1 \) we have \( x=1 \).