Calculating an integral modified Bessel function with singularity

77 Views Asked by At

I'm looking to numerically solve a definite integral involving the modified Bessel function of the second kind, $$\int_{0}^{r}K_0 (r)G(r)r\,dr.$$ The problem is that $K_0$ has a singularity at $r=0$. I saw someplace that it's possible to change the boundary of this integral, but I don't understand why it works: $$\int_{0}^{r}K_0 (r)G(r)r\,dr=-\int_{r}^{\infty} K_0 (r)G(r)r\,dr.$$