Ticket #11445: sage-trac_11445.patch

File sage-trac_11445.patch, 844 bytes (added by mjo, 9 years ago)

Doctest for the correct result.

  • sage/misc/functional.py

    # HG changeset patch
    # User Michael Orlitzky <michael@orlitzky.com>
    # Date 1332423084 14400
    # Node ID 5a339d316469230d5a169f9b617aaf1b4e2fe8e0
    # Parent  72bba20bc1e88b49a1b59f0467133a5e435ae112
    Trac #11445: Add a doctest for a Maxima bug fixed by 5.26.0.
    
    diff --git a/sage/misc/functional.py b/sage/misc/functional.py
    a b  
    706706        1/2*x - 1/4*sin(2*x)
    707707        sage: integral(sin(x)^2, x, algorithm='sympy')
    708708        -1/2*sin(x)*cos(x) + 1/2*x
     709
     710    TESTS:
     711
     712    A symbolic integral from :trac:`11445` that was incorrect in
     713    earlier versions of Maxima::
     714
     715        sage: f = abs(x - 1) + abs(x + 1) - 2*abs(x)
     716        sage: integrate(f, (x, -Infinity, Infinity))
     717        2
     718
    709719    """
    710720    if hasattr(x, 'integral'):
    711721        return x.integral(*args, **kwds)