Ticket #8459: trac-8459.patch

File trac-8459.patch, 1.8 KB (added by robert.marik, 12 years ago)

apply only this patch

  • sage/calculus/calculus.py

    # HG changeset patch
    # User Robert Marik <marik@mendelu.cz>
    # Date 1267912228 -3600
    # Node ID 7c9b25fe33e2d193e52a6246b81ea7d273543237
    # Parent  e11f5bf2d2c2ad28584a0d5cc967c6c0c89ce67e
    #8459 / polylog function
    
    diff -r e11f5bf2d2c2 -r 7c9b25fe33e2 sage/calculus/calculus.py
    a b  
    14251425
    14261426#######################################################
    14271427
    1428 symtable = {'%pi':'pi', '%e': 'e', '%i':'I', '%gamma':'euler_gamma',
    1429             'li[2]':'polylog2', 'li[3]':'polylog3'}
     1428symtable = {'%pi':'pi', '%e': 'e', '%i':'I', '%gamma':'euler_gamma'}
    14301429
    14311430from sage.symbolic.pynac import register_symbol
    14321431from sage.rings.infinity import infinity, minus_infinity
     
    14751474        x#0
    14761475        sage: a.sage()
    14771476        x != 0
     1477
     1478    TESTS:
     1479   
     1480    Trac #8459 fixed::
     1481
     1482        sage: maxima('3*li[2](u)+8*li[33](exp(u))').sage()
     1483        3*polylog(2, u) + 8*polylog(33, e^u)
     1484           
    14781485    """
    14791486    syms = dict(_syms)
    14801487
     
    15051512                syms[X[2:]] = function_factory(X[2:])
    15061513        s = s.replace("?%","")
    15071514
     1515    regex=re.compile('li\[([0-9]+?)\]\(')
     1516    s = regex.sub('polylog(\\1,',s)
    15081517    s = multiple_replace(symtable, s)
    15091518    s = s.replace("%","")
    15101519
  • sage/calculus/tests.py

    diff -r e11f5bf2d2c2 -r 7c9b25fe33e2 sage/calculus/tests.py
    a b  
    105105    sage: expand(integrate(log(1-x^2), x))
    106106    x*log(-x^2 + 1) - 2*x - log(x - 1) + log(x + 1)
    107107    sage: integrate(log(1-x^2)/x, x)
    108     log(-x^2 + 1)*log(x) + 1/2*polylog2(-x^2 + 1)
     108    log(-x^2 + 1)*log(x) + 1/2*polylog(2, -x^2 + 1)
    109109    sage: integrate(exp(1-x^2),x)
    110110    1/2*sqrt(pi)*e*erf(x)
    111111    sage: integrate(sin(x^2),x)