#980 integrate(1/(sin(x)^2+1),x,1,1+%pi) takes forever

Raymond Toy

This is a follow-on to Bug [ 1044318 ]
defint(1/(sin(x)^2+1),x,0,3*%pi) wrong.

integrate(1/(sin(x)^2+1),x,1,1+%pi) seems to take
forever. But if the limits are 0 and %pi, the integral
is evaluated instantly with the correct value.


  • Barton Willis

    Barton Willis - 2006-09-06

    Logged In: YES

    ldefint gives a wrong answer (basically bug 1044318)

    (%i10) ldefint(1/(sin(x)^2+1),x,1,1+%pi);
    (%o10) 0

    integrate gives an antiderivative that isn't continuous
    at odd integer multiples of %pi / 2

    (%i11) integrate(1/(sin(x)^2+1),x);
    (%o11) atan((2*tan(x))/sqrt(2))/sqrt(2)

    The expression

    might be a valid antiderivative on all of R provided the
    first term is assumed left continuous at each odd integer
    multiple of %pi/2, I think.


  • Raymond Toy

    Raymond Toy - 2006-09-06

    Logged In: YES

    Looking at the code for ldefint shows why it returns 0. As
    the docs say, it evaluates the antiderivative and plugs in
    the limits.

    I believe this is why defint uses the routine intsubs and
    same-sheet-subs to handle these issues. Perhaps they're not
    doing what they're supposed to do, but in this particular
    case, maxima is stuck computing the antiderivative. I don't
    understand why.

  • Raymond Toy

    Raymond Toy - 2007-06-22

    Logged In: YES
    Originator: YES

    This integral no longer takes forever. Don't know how it got fixed. The result is wrong, though. See bug 1741705

    Closing this since it no longer directly applies.

  • Raymond Toy

    Raymond Toy - 2007-06-22
    • 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