Peace be upon you,
I had a simple and common question; but surprised after seeing no related results in search engine! I would like to know the numerical integration techniques for improper Riemann integral of the second kind. I am familiar with technique(s) for the first kind (like change of variables).
One simple example is \begin{align*} \int_0^1&{\frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)},}\\\\ &\alpha=\beta=0.5 \end{align*} The integrand is the probability distribution function of the Beta distribution and $B$ represents the Beta function. I know that, obviously, the result is 1, but it was just a simple example for telling what I need. Using the common methods either diverges or loses a significant area in calculation.
The simplest idea is to use the methods which does not calculate the function value in the endpoints and increasing the number of the evaluation points to get a much precise result. But, I am seeking for some better ideas; if any?
The integrand at $x=0$ is asymptotic to $\frac{x^{\alpha-1}(1-0)^{\beta-1}}{B(\alpha,\beta)} = \frac{x^{\alpha-1}}{B(\alpha,\beta)}$; if you subtract that function from the integrand, the result has a finite limit as $x\to0^+$. Similarly, the integrand at $x=1$ is asymptotic to $\frac{(1-x)^{\beta-1}}{B(\alpha,\beta)}$, so subtracting that function results in a finite limit as $x\to1^-$. Therefore I suggest writing \begin{align*} \int_0^1 \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}dx &= \int_0^1 \bigg( \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}dx - \frac{x^{\alpha-1}}{B(\alpha,\beta)} - \frac{(1-x)^{\beta-1}}{B(\alpha,\beta)} \bigg) \\ &\qquad{}+ \int_0^1 \frac{x^{\alpha-1}}{B(\alpha,\beta)}dx + \int_0^1 \frac{(1-x)^{\beta-1}}{B(\alpha,\beta)}dx \\ &= \int_0^1 \frac{x^{\alpha-1}(1-x)^{\beta-1} - x^{\alpha-1} - (1-x)^{\beta-1}}{B(\alpha,\beta)}dx + \frac1\alpha + \frac1\beta. \end{align*} The remaining integral should be much more amenable to numerical integration.