Open EmmanuelJeanBriand opened 2 years ago
hmmm, giac and libgiac sort of works:
sage: giac('int(e^x/(x^2+1),x,-pi,pi)')
5.27595245778
sage: giac('int(e^x/(x^2+1),x)')
(im(Ei(x+i))*tan(1/2)^2-im(Ei(x+i))-im(Ei(x-i))*tan(1/2)^2+im(Ei(x-i))+2*re(Ei(x+i))*tan(1/2)+2*re(Ei(x-i))*tan(1/2))/(2*tan(1/2)^2+2)
sage: libgiac('int(e^x/(x^2+1),x,-pi,pi)')
// Giac share root-directory:/home/chapoton/sage/local/share/giac/
// Giac share root-directory:/home/chapoton/sage/local/share/giac/
Help file /home/chapoton/sage/local/share/giac/doc/fr/aide_cas not found
Added 0 synonyms
5.27595245778
sage: libgiac('int(e^x/(x^2+1),x)')
(im(Ei(x+i))*tan(1/2)^2-im(Ei(x+i))-im(Ei(x-i))*tan(1/2)^2+im(Ei(x-i))+2*re(Ei(x+i))*tan(1/2)+2*re(Ei(x-i))*tan(1/2))/(2*tan(1/2)^2+2)
This works in sage 10.1.beta3
sage: integrate(e^x/(x^2+1), x, -pi, pi, algorithm='giac')
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)
The following computation runs forever (> 20 min):
on the following versions/systems:
Interrupting gives the message:
giac version is 1.6.0
After running once the command, and interrupting, running again the command several times may give wrong answers:
even with integrals of the same function on another interval:
The problem does not arise
when integrating the same function on another interval, e.g. [0;pi] or [-pi;0] instead of [-pi; pi] (unless the troublesome command was run and interrupted before).
in some versions/systems: Sage 9.5.rc1 running in Debian testing, as reported with more details in https://groups.google.com/d/msgid/sage-devel/aa218dff-79d2-48ee-837f-8f875bb0dbf2n%40googlegroups.com
Component: calculus
Keywords: integrate, giac
Issue created by migration from https://trac.sagemath.org/ticket/33245