Maxima's answer is wrong:
(%i1) integrate(sin(x)/x,x,-1,1);
(%o1) %i*gamma_incomplete(0,-%i)-%i*gamma_incomplete(0,%i)
(%i2) expand(%),numer;
(%o2) -1.249426512855427
No way this can be negative!
The right answer would be about 1.89217.
Also, from 0 to 1 it can't be done at all:
(%i3) integrate(sin(x)/x,x,0,1);
(%o3) integrate(sin(x)/x,x,0,1)
I think what's going on is the following: Maxima's antiderivative for sin(x)/x is -(%i*gamma_incomplete(0,%i*x)-%i*gamma_incomplete(0,-%i*x))/2 instead of expintegral_si(x). The former antiderivative has a discontinuity at x=0, which Maxima doesn't notice, and so it just plugs the limits into the antiderivative, which leads to a wrong result.
https://dl.dropboxusercontent.com/u/845597/discontinuity.png
See also the discussion in bug report #2941 (https://sourceforge.net/p/maxima/bugs/2941/)
I think the problem here is that Maxima just plugs the integration bounds into the antiderivative without checking for discontinuities in it. Or maybe it does check, but doesn't see the discontinuity at
x=0?In fact, tracing the function
discontinuities-in-intervalreveals that it returnsnofor the antiderivative. So Maxima thinks it's OK to do justF(b)-F(a).I have changed the
discontinuities-in-intervalfunction to look for discontinuities in gamma_incomplete as well. This makes Maxima return a noun form forintegrate(sin(x)/x,x,-1,1), which is better than a wrong answer. But we can do better by converting Maxima's antiderivative intoexpintegral_si(x), which is continuous and therefore great for definite integration. I will implement this.Has there been any progress on this? It is affecting SageMath also