Make doctest from #25626 more robust
kiwifb opened this issue · 11 comments
The doctest, introduced in #25656 to check that sage can perform a particular integral with giac, can break depending on the version of giac used.
The integral is expressed as
integrate(exp(t)/(t + 1)^2, t, algorithm="giac")
With giac 1.7 the returned result is
(t*Ei(t + 1) + Ei(t + 1) - e^(t + 1))/(t*e + e)
and with giac 1.9 it is
((t + 1)*(1/(t + 1) - 1)*Ei(-(t + 1)*(1/(t + 1) - 1) + 1) - Ei(-(t + 1)*(1/(t + 1) - 1) + 1) + e^(-(t + 1)*(1/(t + 1) - 1) + 1))/((t + 1)*(1/(t + 1) - 1)*e - e)
Both answers are equivalent and applying full_simplify to both expressions gives
((t + 1)*Ei(t + 1) - e^(t + 1))/(t*e + e)
Component: calculus
Author: François Bissey
Branch/Commit: 2121a96
Reviewer: Kwankyu Lee
Issue created by migration from https://trac.sagemath.org/ticket/34037
Branch: u/fbissey/trac34037
Ready for review.
New commits:
cb3a8c5 | make the result of trac #25626 doctest independent of giac version |
Author: François Bissey
diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
index 0dfcadf474..536332995e 100644
--- a/src/sage/calculus/calculus.py
+++ b/src/sage/calculus/calculus.py
@@ -381,7 +381,8 @@ Ensure that :trac:`8624` is fixed::
sage: integrate(sqrt(cos(x)^2 + sin(x)^2), x, 0, 2*pi)
2*pi
-Ensure that :trac:`25626` is fixed, as the form of the answer is dependent of the giac version we simplify it (see :trac:`34037`) ::
+Ensure that :trac:`25626` is fixed. As the form of the answer is dependent of
+the giac version, we simplify it (see :trac:`34037`). ::
sage: t = SR.var('t')
sage: integrate(exp(t)/(t + 1)^2, t, algorithm="giac").full_simplify()Branch pushed to git repo; I updated commit sha1. New commits:
2121a96 | Format the documentation string following suggestion of klee. |
Thanks for the comments on the formatting. Adopted.
LGTM.
Reviewer: Kwankyu Lee
Changed branch from u/fbissey/trac34037 to 2121a96