Skip to content

Commit ccbb200

Browse files
committed
src/sage/symbolic/integration/integral.py: delete a doctest
We have a doctest that is testing for an unevaluated integral: sage: A = integral(1/ ((x-4) * (x^4+x+1)), x); A integrate(1/((x^4 + x + 1)*(x - 4)), x) This is now failing because we output the maxima answer, -1/261*integrate((x^3 + 4*x^2 + 16*x + 65)/(x^4 + x + 1), x) + 1/261*log(x - 4) rather than the giac answer, which is completely unevaluated. In an earlier commit, giac was removed from the default list of integration backends whenever giac is not actually installed because this produces better error messages. But, as a side effect, we are no longer skipping over the partial maxima answer to accept the unevaluated giac answer. (This is actually an improvement in the case where giac is not installed and where sympy raises an error.) There is no important result tested by these lines, so I think the least confusing thing to do is re-word the surrounding paragraph a bit and delete this test. There are still other tests nearby for partial evaluation of hard integrals.
1 parent c8e63cb commit ccbb200

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

src/sage/symbolic/integration/integral.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -655,17 +655,12 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
655655
sage: g.integrate(x).sort() # optional - maple
656656
x*y^z+1/2*2^(1/2)*Pi^(1/2)*FresnelS(2^(1/2)/Pi^(1/2)*x)
657657
658-
We next integrate a function with no closed form integral. Notice
659-
that the answer comes back as an expression that contains an
660-
integral itself. ::
658+
We next integrate a function with no closed-form integral. The
659+
integral has been evaluated to some extent, but the answer itself
660+
contains an integration. We specify the maxima backend because the
661+
other implementations can produce slightly different results::
661662
662-
sage: A = integral(1/ ((x-4) * (x^4+x+1)), x); A
663-
integrate(1/((x^4 + x + 1)*(x - 4)), x)
664-
665-
Sometimes, in this situation, using the algorithm "maxima"
666-
gives instead a partially integrated answer::
667-
668-
sage: integral(1/(x**7-1),x,algorithm='maxima')
663+
sage: integral(1/(x**7-1), x, algorithm='maxima')
669664
-1/7*integrate((x^5 + 2*x^4 + 3*x^3 + 4*x^2 + 5*x + 6)/(x^6 + x^5 + x^4 + x^3 + x^2 + x + 1), x) + 1/7*log(x - 1)
670665
671666
We now show that floats are not converted to rationals

0 commit comments

Comments
 (0)