I want to integrate let's say $f(x)=\sin(x)$ over the interval $(0,2\pi)$ using Monte Carlo Integration. I did so by using R.
I generated a random set of uniform numbers $(x)$ and took the mean of $f(x)$ then multiplied it by the interval length (2pi). Now I don't understand why we have to multiply the mean by the interval length to get the area.
If I want to create a confidence interval of this area obtained, I would need to find the standard deviation, do I just get the standard deviation of $f(x)$ and multiply it by $2\pi$, or multiply $f(x)$ by $2 \pi $ then get the standard deviation of that or what? I really don't understand why am multiplying by $2\pi$ to begin with so if you can explain that to me and let me know how to obtain a CI, that would be great!!!