I am interested to find out:

$\displaystyle \int ((\frac{2(cos(\pi x/2)}{3(1-x^2)}-\frac{2}{\pi})^2. 3(1-x^2)/2.dx$

I want use $\displaystyle \frac{1}{m}\displaystyle\sum_{i=1}^{m}(\frac{2(cos (\pi x^{(i)}/2)}{3(1-x^{(i)}^2)})^2$ where $\displaystyle x^{(i)}$ is drawn from $\displaystyle 3(1-x^2)/2$ (a density defined from 0<x<1).

The question is simple. How can I draw a random sample of let say 10000 from the density $\displaystyle f(x)= 3(1-x^2)/2$ ?

What I did is to generate 10000 random uniform variable and subst into the equation.

For example:

x=runif(10000)

g=3(1-x^2)/2

but the answer is still wrong after computation

Meanwhile finding this inverse is hard