Skip to content

Commit 3196bd6

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 8b508ec commit 3196bd6

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
@@ -653,17 +653,12 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
653653
sage: g.integrate(x).sort() # optional - maple
654654
x*y^z+1/2*2^(1/2)*Pi^(1/2)*FresnelS(2^(1/2)/Pi^(1/2)*x)
655655
656-
We next integrate a function with no closed form integral. Notice
657-
that the answer comes back as an expression that contains an
658-
integral itself. ::
656+
We next integrate a function with no closed-form integral. The
657+
integral has been evaluated to some extent, but the answer itself
658+
contains an integration. We specify the maxima backend because the
659+
other implementations can produce slightly different results::
659660
660-
sage: A = integral(1/ ((x-4) * (x^4+x+1)), x); A
661-
integrate(1/((x^4 + x + 1)*(x - 4)), x)
662-
663-
Sometimes, in this situation, using the algorithm "maxima"
664-
gives instead a partially integrated answer::
665-
666-
sage: integral(1/(x**7-1),x,algorithm='maxima')
661+
sage: integral(1/(x**7-1), x, algorithm='maxima')
667662
-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)
668663
669664
We now show that floats are not converted to rationals

0 commit comments

Comments
 (0)