#612 defint(1/(sin(x)^2+1),x,0,3*%pi) wrong


INTEGRATE(1/(SIN(x)^2+1),x,0,3*%PI) => 0

Since the integrand is everywhere >= 1/2, the integral
cannot be zero -- in fact


k*pi/sqrt(2) (real q, integral k)

Presumably defint is using the indefinite integral
atan(2*tan(x)/sqrt(2))/sqrt(2) inappropriately.


  • Robert Dodier

    Robert Dodier - 2006-07-31

    Logged In: YES

    Observed in 5.9.3cvs. I find

    defint(1/(sin(x)^2+1),x,0,3*%pi); =>

    but then ratsimp(%) => 0 .

  • Robert Dodier

    Robert Dodier - 2006-07-31
    • labels: --> Lisp Core - Integration
  • Raymond Toy

    Raymond Toy - 2006-09-01

    Logged In: YES

    I think the problem is caused by INFR. I think it's
    supposed to compute how many full periods and fractional
    periods are in the integral, but it does it incorrectly.

    The following replacement:

    (defun infr (a)
    (let* ((q (igprt (div a (mul 2 '$%pi))))
    (r (add a (mul -1 (mul q 2 '$%pi)))))
    (cons q r)))

    works much better for this example, and we get 3*pi/sqrt(2),
    as expected.

    In the results shown by Robert, ratsimp produces zero
    because atan is using the principal result, but defint is
    trying to tell you to be careful by returning

  • Raymond Toy

    Raymond Toy - 2006-09-05

    Logged In: YES

    Closing this report.

    The function INFR has been replaced with a new version that
    works for this case.

    I've also updated INTSC1 so that it can handle the case
    where the limits are q and q + k * 2 * %pi, for k a
    numerical integer.

    There are still other issues, which we be in a new bug report.

  • Raymond Toy

    Raymond Toy - 2006-09-05
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks