Menu

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

closed
nobody
5
2006-09-05
2004-10-11
No

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

integrate(1/(sin(x)^2+1),x,q,q+k*%pi)

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

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

Discussion

  • Robert Dodier

    Robert Dodier - 2006-07-31

    Logged In: YES
    user_id=501686

    Observed in 5.9.3cvs. I find

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

    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
    user_id=28849

    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
    atan(sqrt(2)*tan(3*%pi))...

     
  • Raymond Toy

    Raymond Toy - 2006-09-05

    Logged In: YES
    user_id=28849

    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.