Menu

#2823 Yet another abs_integrate problem

None
closed
nobody
None
5
2021-11-14
2014-10-20
kcrisman
No

See http://ask.sagemath.org/question/24532/ for the following problem. Downstream bug report at http://trac.sagemath.org/ticket/17183

(%i5) load(abs_integrate);
(%o5) /Users/.../sage/local/share/maxima/5.34.1/share/contr\
ib/integration/abs_integrate.mac
(%i6) integrate( sqrt((cos(x) - 1)^2 + sin(x)^2), x, 0, 2*%pi);
(%o6)                                  0

This is done correctly in "vanilla" Maxima. The precise problem is probably (compare):

(%i7) integrate( sqrt((cos(x) - 1)^2 + sin(x)^2), x);
                         2                        1
(%o7)  2 (2 - -----------------------) signum(----------) signum(sin(x))
                         2                    cos(x) + 1
                  sin (x)
          sqrt(------------- + 1)
                           2
               (cos(x) + 1)

versus

(%i1) integrate( sqrt((cos(x) - 1)^2 + sin(x)^2), x);
                           atan2(sin(x), cos(x)) + %pi
(%o1) (- 2 cos(x) - 2) sin(---------------------------)
                                    2
                                               atan2(sin(x), cos(x)) + %pi
                                + 2 sin(x) cos(---------------------------)
                                                            2

Discussion

  • Robert Dodier

    Robert Dodier - 2014-10-20

    Thanks for the report. I don't mean to sound ungrateful, but what, exactly, are we to compare here? If you know the correct result, which one is it? What is the difference between the two expressions which the reader is supposed to compare? I could probably puzzle it out, but in the interest of solving the problem, maybe you can just tell us what you have figured out so far. Thanks again for your help.

     
  • Robert Dodier

    Robert Dodier - 2014-10-20
     
  • kcrisman

    kcrisman - 2014-10-20

    Sorry! If you click through to the ask.sagemath thing you'll see the correct answer is 8, which one gets when doing a definite integral in Maxima without abs_integrate.

    (%i2) integrate( sqrt((cos(x) - 1)^2 + sin(x)^2), x, 0, 2*%pi);
    (%o2)                                  8
    
     
  • Barton Willis

    Barton Willis - 2021-11-14
    • status: open --> closed
     
  • Barton Willis

    Barton Willis - 2021-11-14

    Fixed by [3ca423] . Closing ticket.

     

    Related

    Commit: [3ca423]


Log in to post a comment.