Numerical instable integrals

71 Views Asked by At

I tried to calculate the value of the integral

I(n) := $\int_{0}^{\infty}\frac{dx}{x^n+x^2+1}$ particularly for even and very large n, (for example n=1000) with PARI and wolfram alpha. The results did not coincide, so the calculation seems to be numerically unstable. Here are my questions :

1) Is there a general formula for calculating I(n) ?

2) How can the calculation be made numerically stable ?

3) Is it true that $\lim_{n->\infty} I(n)$ = $\frac{\pi}{4}$ and if yes, how can it be proven ?

I tried to use the identity

$\frac{1}{x^2+1}-\frac{x^n}{(x^2+1)(x^n+x^2+1)}=\frac{1}{x^n+x^2+1}$ ,

but the calculation seems to keep numerically unstable.