Integral: Product of sqrt and Gaussian All,
I would have thought mathematica could do this, but it can't. Can anyone think of a good substitution that makes it tractable? Or even do the integral otherwise?
$$
\int_{0}^{R}e^{-\beta x^{2}}\left(R-g-\sqrt{R^{2}-x^{2}}\right)dx\
$$
 A: Well, splitting into two part gives: $$\int_{0}^{R}e^{-\beta x^{2}}\left(R-g-\sqrt{R^{2}-x^{2}}\right)\mathrm dx=(R-g)\int_{0}^{R}e^{-\beta x^{2}}\mathrm dx-\int_{0}^{R}e^{-\beta x^{2}}\sqrt{R^{2}-x^{2}}\mathrm dx$$
So from the definition of the error function one gets:
$$(R-g)\int_{0}^{R}e^{-\beta x^{2}}\mathrm dx=(R-g)\frac{\sqrt{\pi }}{2 \sqrt{\beta }}\text{erf}\left(\sqrt{\beta } R\right)$$
For the second term one can make substitution $y=\frac{x}{R}$:
$$\int_{0}^{R}e^{-\beta x^{2}}\sqrt{R^{2}-x^{2}}\mathrm dx=R^2\int_{0}^{1}e^{-\beta R^{2}y^{2}}\sqrt{1-y^{2}}\mathrm dy=\frac{R^2}{4} \pi  e^{-\frac{1}{2} \left(\beta  R^2\right)} \left(I_0\left(\frac{R^2 \beta }{2}\right)+I_1\left(\frac{R^2 \beta }{2}\right)\right)$$
where $I_0(\cdot)$ and $I_1(\cdot)$ are modified Bessel functions.
A brief explanation.
 One can use the substitution $y=\sin(x)$:
$$
\begin{eqnarray}
\int_{0}^{1}e^{-\beta R^{2}y^{2}}\sqrt{1-y^{2}}\mathrm dy&=&\int_{0}^{\frac{\pi}{2}}e^{-\beta R^{2}\sin^{2}(x)}\sqrt{1-\sin^{2}(x)}\mathrm d(\sin(x))=\\
&=&\int_{0}^{\frac{\pi}{2}}e^{-\beta R^{2}\left(\frac{1-\cos(2x)}{2}\right)}|\cos(x)|\cos(x)\mathrm dx=\\ 
&=&e^{-\frac{\beta R^{2}}{2}}\int_{0}^{\frac{\pi}{2}}e^{\frac{\beta R^{2}}{2}\cos(2x)} \left(\frac{1+\cos(2x)}{2}\right) \mathrm dx=\\
&=&\frac{e^{-\frac{\beta R^{2}}{2}}}{2}\int_{0}^{\frac{\pi}{2}}e^{\frac{\beta R^{2}}{2}\cos(2x)} (1+\cos(2x)) \mathrm dx=\\
&=&\frac{e^{-\frac{\beta R^{2}}{2}}}{4}\int_{0}^{\pi}e^{\frac{\beta R^{2}}{2}\cos(x)} \mathrm dx+\frac{e^{-\frac{\beta R^{2}}{2}}}{4}\int_{0}^{\pi}e^{\frac{\beta R^{2}}{2}\cos(x)} \cos(x) \mathrm dx
\end{eqnarray}
$$
At last one can use the integral representation of the modified Bessel function:
$$ \mathop{I_{{n}}}\nolimits\!\left(z\right)=\frac{1}{\pi}\int_{0}^{\pi}e^{{z%
\mathop{\cos}\nolimits x}}\mathop{\cos}\left(nx\right)%
\mathrm d x.$$
and get the answer.
