Numerical Integration of a singular function

54 Views Asked by At

I have a following function: $$f(r)=\int_{r}^{\infty}\frac{g(y)\mathrm{d}y}{\sqrt{y^2-r^2}}~,$$ where $g(y)$ is a continuous function and $g(r)\neq 0$ and $g(r\rightarrow\infty)=0$. Now, in reality I do not have a full functional form for $g(y)$: all I have is data points $g(y_i)$ for $y_i\epsilon (r, \infty)$. And I need to estimate $f(r)$ based on the data points $g(y_i)$. Assuming an equal separation of $y_i$, so that $\Delta y=y_{i+1}-y_i$ for all $i$, the approach is carrying out summation: $$f(r)\approx \Delta y\sum_{i}\frac{g(y_i)}{\sqrt{y_i^2-r^2}}~.$$ However, there is a problem in the summation, as the term $g(y_i=r)/\sqrt{(y_i=r)^2-r^2}$ is divergent. Is there any way to fix this issue, given that I do not have closed functional form of $g(y)$ but just the data points?

1

There are 1 best solutions below

0
On

We can get rid of the problem at $y=r$ and change the integral over an infinite domain to a finite one using the substitution $y=r\sec(u)$: $$ \begin{align} \int_r^\infty\frac{g(y)\,\mathrm{d}y}{\sqrt{y^2-r^2}} &=\int_0^{\pi/2}g(r\sec(u))\sec(u)\,\mathrm{d}u\\ \end{align} $$