I have calculated a two-particle distribution function called $f(r)$ where $r$ is the distance between of two particle (also there are three parameters,$\alpha$, $\beta$ and $\gamma$ in its formula which I should calculate $f(r)$ for different values of them). I have been asked: Calculate the average value of $r$ and the variance of distribution which shows the width of distribution. So I tried this (according to standard formula for variance of continuous variable in Wiki): $$ \operatorname{Var}(r)=\int_0^{\infty}r^2 f(r)\,\mathrm dr-\biggl(\int_0^{\infty}r f(r)\,\mathrm dr \biggr)^2 $$ but it returns negative value for some parameters. Am I wrong? If Yes how can I calculate what I was asked?
Asked
Active
Viewed 63 times
NIntegrate
instead of analytical integration in Mathematica. Now all results are OK. – Wisdom Jun 11 '21 at 18:58