Ticket #10434: trac-10434_doctests.patch

File trac-10434_doctests.patch, 1.9 KB (added by mvngu, 9 years ago)
  • sage/calculus/calculus.py

    # HG changeset patch
    # User Minh Van Nguyen <nguyenminh2@gmail.com>
    # Date 1291645089 28800
    # Node ID 759119c1e406cbd9b87f81eb702ba800a3574f4a
    # Parent  1cb202e8a606dc2ab85489ff9df9cb4ea78c1aa1
    #10434: more doctests for integrate(), ensuring that #8624 and #8582 are fixed
    
    diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
    a b  
    344344    -1/432*((36*(pi*sqrt(3) + 9*log(3))*euler_gamma^2 + 27*pi^2*log(3) + 72*euler_gamma^3 + 243*log(3)^3 + 18*(6*pi*sqrt(3)*log(3) + pi^2 + 27*log(3)^2 + 12*psi(1, 1/3))*euler_gamma + 324*psi(1, 1/3)*log(3) + (pi^3 + 9*(9*log(3)^2 + 4*psi(1, 1/3))*pi)*sqrt(3))*gamma(1/3) - 72*gamma(1/3)*psi(2, 1/3))*x^3 + 1/24*(6*pi*sqrt(3)*log(3) + 4*(pi*sqrt(3) + 9*log(3))*euler_gamma + pi^2 + 12*euler_gamma^2 + 27*log(3)^2 + 12*psi(1, 1/3))*x^2*gamma(1/3) - 1/6*(6*euler_gamma + pi*sqrt(3) + 9*log(3))*x*gamma(1/3) + gamma(1/3)
    345345    sage: map(lambda f:f[0].n(), _.coeffs())  # numerical coefficients to make comparison easier; Maple 12 gives same answer
    346346    [2.6789385347..., -8.3905259853..., 26.662447494..., -80.683148377...]
     347
     348Ensure that ticket #8582 is fixed::
     349
     350    sage: k = var("k")
     351    sage: sum(1/(1+k^2), k, -oo, oo)
     352    1/2*I*psi(-I) - 1/2*I*psi(I) + 1/2*I*psi(-I + 1) - 1/2*I*psi(I + 1)
     353
     354Ensure that ticket #8624 is fixed::
     355
     356    sage: integrate(abs(cos(x)) * sin(x), x, pi/2, pi)
     357    1/2
     358    sage: integrate(sqrt(cos(x)^2 + sin(x)^2), x, 0, 2*pi)
     359    2*pi
    347360"""
    348361
    349362import re
  • sage/calculus/functional.py

    diff --git a/sage/calculus/functional.py b/sage/calculus/functional.py
    a b  
    236236   
    237237        sage: integral(abs(x), x, 0, 5)
    238238        25/2
     239        sage: a = var("a")
     240        sage: integral(abs(x), x, 0, a)
     241        1/2*a*abs(a)
    239242        sage: integral(abs(x)*x, x, 0, a)
    240243        Traceback (most recent call last):
    241244        ...