Can’t reproduce on Sage 9.5.rc1 running in Debian testing. First thing after session start :
sage: integrate(e^x/(x^2+1), x, -pi, pi)
// Giac share root-directory:/usr/share/giac/
// Giac share root-directory:/usr/share/giac/
Added 0 synonyms
1/2*(imag_part(Ei(pi + I))*tan(1/2)^2 - imag_part(Ei(pi - I))*tan(1/2)^2 + 2*real_part(Ei(pi + I))*tan(1/2) + 2*real_part(Ei(pi - I))*tan(1/2) - imag_part(Ei(pi + I)) + imag_part(Ei(pi - I)))/(tan(1/2)^2 + 1) - 1/2*(imag_part(Ei(-pi + I))*tan(1/2)^2 - imag_part(Ei(-pi - I))*tan(1/2)^2 + 2*real_part(Ei(-pi + I))*tan(1/2) + 2*real_part(Ei(-pi - I))*tan(1/2) - imag_part(Ei(-pi + I)) + imag_part(Ei(-pi - I)))/(tan(1/2)^2 + 1)
BTW:
sage: integrate(e^x/(x^2+1), x).simplify_full()
1/2*(2*I*cos(1/2)^2 + 2*cos(1/2)*sin(1/2) - I)*Ei(x + I) + 1/2*(-2*I*cos(1/2)^2 + 2*cos(1/2)*sin(1/2) + I)*Ei(x - I)
sage: integrate(e^x/(x^2+1), x, algorithm="fricas").simplify_full()
1/2*(-I*Ei(x - I)*e^(2*I) + I*Ei(x + I))*e^(-I)
And these expressions are equal :
sage: integrate(e^x/(x^2+1), x).trig_reduce().exponentialize().factor()
-1/2*I*(Ei(x - I)*e^(2*I) - Ei(x + I))*e^(-I)
sage: integrate(e^x/(x^2+1), x, algorithm="fricas")
-1/2*I*(Ei(x - I)*e^(2*I) - Ei(x + I))*e^(-I)
Mathematica gives the same (mathematical) result (but this can’t be backtranslated to Sage now, for lack of ExpIntegralEi in the translation dictionary) :
sage: mathematica.Integrate(e^x/(x^2+1), x)
((-I/2)*(E^(2*I)*ExpIntegralEi[-I + x] - ExpIntegralEi[I + x]))/E^I
HTH,
Okay. That’s a nice one…
After upgrading to 9.5.rc5 and disabling system’s pari and singular (for other reasons, see there), configure somehow decided to install the giac SPKG and not to use system’s giac.
This triggered the behaviour your reported. Ahiii…
FWIW, system’s giac version is 1.7.0, Sage’s is 1.6.0.
HTH,
To add insult to injury, trying to re-enable system’s giac (make giac-clean && configure failed. Somehow,./configurefinds no *suitable* systemgiacversion, and re-builds Sage's giac. It seems that I should also cleanpari` and consorts and re-re-build…
Sigh…
2022-01-30 05:10:25 UTC, Emmanuel Charpentier:
>
> After upgrading to 9.5.rc5 and disabling system’s pari and singularDid you mean "after upgrading to 9.5.rc4"?
FWIW, after rebuilding Sage with system’s giac :
sage: integrate(e^x/(x^2+1), x, -pi, pi)
1/2*(imag_part(Ei(pi + I))*tan(1/2)^2 - imag_part(Ei(pi - I))*tan(1/2)^2 + 2*real_part(Ei(pi + I))*tan(1/2) + 2*real_part(Ei(pi - I))*tan(1/2) - imag_part(Ei(pi + I)) + imag_part(Ei(pi - I)))/(tan(1/2)^2 + 1) - 1/2*(imag_part(Ei(-pi + I))*tan(1/2)^2 - imag_part(Ei(-pi - I))*tan(1/2)^2 + 2*real_part(Ei(-pi + I))*tan(1/2) + 2*real_part(Ei(-pi - I))*tan(1/2) - imag_part(Ei(-pi + I)) + imag_part(Ei(-pi - I)))/(tan(1/2)^2 + 1)
sage: giac.version()
"giac 1.7.0, (c) B. Parisse and R. De Graeve, Institut Fourier, Universite de Grenoble I"
But now, ptestlong exhibits new bugs. Sigh (again)…
HTH,