Difference Integration results from mathematica.

59 Views Asked by At

enter image description here

N[Integrate[.]] gives me a quite large number while NItegrate[.] gives me a small one. According to plot of integrand, it seems the numerical integration is more reasonable. However, can anyone explain what's the problem here? Thanks!

2

There are 2 best solutions below

0
On BEST ANSWER

I think that you could ask the question at https://mathematica.stackexchange.com/.

This seems to be related to accuracy issues since the explicit formula in terms of $x$ is correct but for $x=100$, the result is $$-\frac{18004190799729005916153364606626760}{9009}+$$ $$99920027994400699944002799920001 \log \left(\frac{101}{99}\right)$$ which does not look simple (on my side, I gave up).

Computing each piece separately to $50$ significant decimals, I effectively obtained $0.0059908$.

Edit

In fact, problems happen even for quite small values of $x$. We even can get negative values for the integral. For example, using $x=11$, the result is given as $\color{red}{-1.00000}$ while it corresponds to $$42998169600000000 \log \left(\frac{6}{5}\right)-\frac{32102724739022409728}{4095}$$ Doing the same as above, this is $0.0544852$ which is exactly the value obtained using numerical integration.

0
On

I second Claude Leibovici's answer by providing the following computation using Mathematica 11

Mathematica computation

As you see, specifying the tolerance does give a correct numerical result. So it seems that there is an issue with N[] function without second argument.