I have the following integral:
$$ I_p = \int_0^1 x^{p-1}(ax + b) e ^{-(ax + b)^2/N}dx$$
where
$$ \{x,a,b\} \in (-\infty,\infty), \; N \in (0,\infty), \; p \in \mathbb Z, p \geq 1 . $$
I want to find a stable formula for computation of $J_p$.
(a) I am able to obtain a recursion using the integration by parts formula between $J_p, J_{p-1}$ and $J_{p-2}$, but there is $a$ in the denominator which can take small values close to zero and hence the recursion blows up.
(b) I do not want to do it numerically as it is not as efficient.
I want to know if this integral can be expression as some function which can be computed efficiently?
1) Recursion:
Now, $$I_p = a J_p + b J_{p-1}$$
such that
$$ J_p = \int_0^1 x^{p} e ^{-(ax + b)^2/N}dx$$
And we can get a recursion on the above integral as:
$$J_{p+1} = \frac{Np}{2a^2} J_{p-1} - \frac{b}{a} J_p - \frac{N}{2a^2} e^{-(a+b)^2/N}$$
I have the closed form expressions for $J_0$ and $J_1$ in terms of erf or normal cdf. The problem is that $a$ and its powers are in denominator, causing recursion to be unstable.
If $J_{p+1} = \frac{Np}{2a^2} J_{p-1} - \frac{b}{a} J_p - \frac{N}{2a^2} e^{-(a+b)^2/N} $, then multuplying by $a^{p+1}$, $a^{p+1}J_{p+1} = \frac{Np}{2} a^{p-1}J_{p-1} - a^p J_p - \frac{N}{2}a^{p-1} e^{-(a+b)^2/N} $.
If we let $K_p = a^p J_p $, this becomes $K_{p+1} = \frac{Np}{2} K_{p-1} - K_p - \frac{N}{2}a^{p-1} e^{-(a+b)^2/N} $.
This looks like it might be more stable.