# Why does Integrate have so much trouble evaluating my integral?

Why are the answers for the following integrals different (the second one gives the correct answer)?

Integrate[(0.6090793168195031 - (2.2737783592977756*(30/
49 + (156/49)*(-2 + 2*s) + (429/196)*(-2 + 2*s)^2))/(1 -
s)^(1/7))*
(s/Sqrt[1 - s^2]), {s, 0, 1}]

Integrate[0.6090793168195031*(s/Sqrt[1 - s^2]), {s, 0, 1}] -
Integrate[((2.2737783592977756*(30/
49 + (156/49)*(-2 + 2*s) + (429/196)*(-2 + 2*s)^2))/(1 -
s)^(1/7))*(s/Sqrt[1 - s^2]),
{s, 0, 1}]


P.S. I know that the numerical evaluation of the integral (NIntegrate) gives me the correct answer.

P.S.S. The version of my Mathematica is 10.4.0.0

• Interesting. If you do a FullSimplify on the integrand of the first integral above, then it resolves to almost zero. If you leave the integrand as-is or just do a Simplify on it, you get 4.11 or so. If you NIntegrate it, you have to use "LocalAdaptive" method to avoid convergence warnings and get almost zero. Odd things happen when you have zero in denominator. – MikeY Jun 16 '17 at 15:19
• But why do a numerical integral with Integrate[]? It's not really designed for that. – Michael E2 Jun 17 '17 at 0:22

Note that

Integrate[
s/Sqrt[1 - s^2]
(Rationalize[0.6090793168195031] -
(Rationalize[2.2737783592977756] *
(30/49 + (156/49)*(-2 + 2*s) + (429/196)*(-2 + 2*s)^2)) / (1 -s)^(1/7)),
{s, 0, 1}]


gives

4.11522

This gives the same result to your 1st integral and tells us that rationalization is being used by Integral.

To see why the integrals are so difficult to evaluate, we need only look at a plot to see the nasty singularities at s = 1.

expr1 = 0.6090793168195031*s/Sqrt[1 - s^2]
expr2 =
2.2737783592977756*(s/Sqrt[1 - s^2]*
(30/49 + (156*(-2 + 2*s))/49 + (429*(-2 + 2*s)^2)/196))/(1 - s)^(1/7)
expr = expr1 - expr2;

Plot[{expr, expr1, expr2}, {s, 0, 1}, PlotLegends -> {"expr", "expr1", "expr2"}]


I would further argue that you can not trust any evaluation of your integral over the full domain {0, 1} as long as you have the two inexact coefficients 0.6090793168195031 and 2.2737783592977756 in the integrand. Because these coefficients are inexact, there will always be a interval of uncertainty in the neighborhood of 1. No matter how many digits in the coefficients are known, as long a they are inexact, there is an $\epsilon > 0$ such that the value of integrand in the interval $(1-\epsilon,\,1]$ has no precision and its behavior can not be known.