Menu

#3295 Incorrect integral of rational expression of trigonometric function

None
open
nobody
5
2017-06-13
2017-03-19
No

integrate((2*cos(2*%pi*x) - cos(4*%pi*x)) / (5 - 4*cos(2*%pi*x)), x, 0, 1);

returns 23/24 (tested in maxima-online.org), but the result should be 1/4.

See also: https://trac.sagemath.org/ticket/17968

Discussion

  • Marcelo Forets

    Marcelo Forets - 2017-03-19

    ooops.. posted the wrong link! See also: https://trac.sagemath.org/ticket/21440

     
  • David Scherfgen

    David Scherfgen - 2017-03-19

    Maxima's antiderivative has a discontinuity at x=1/2, which it doesn't detect, so it just does F(1)-F(0). I believe that's where the error comes from.

     
    • Robert Dodier

      Robert Dodier - 2017-03-20

      I dunno if ignoring the discontinuity is the only problem here. integrate(..., x, 0, 1/2) returns 23/24 which seems to be incorrect (should be 1/8 I guess).

      integrate(..., x) returns an antiderivative and then ev(%, x = 1/2 - foo) - ev(%, x = 0) followed by limit(%, foo, 0, plus) yields 1/8. I don't know where it goes wrong.

       
  • number Zero

    number Zero - 2017-06-13

    The same problem here:

    integrate(
    (1 / %pi) * sqrt(r) * (1 - r) *
    (cos(2 * psi) - 1) *
    (
        (cos((phi + psi)/2)) / (1 - 2*r*cos(phi + psi) + r^2) +
        (cos((phi - psi)/2)) / (1 - 2*r*cos(phi - psi) + r^2)
    )
    , psi, 0, %pi
    );
    

    Numerical solution seems to be right (it is calculated at r=0.99; at r=1.00 it should be cos(2 * phi) - 1), but symbolic one is radically different. Note that it is calculated using ldefint; integrate yields similarly looking non-smooth function (full of atan(tan(phi)))

     

Log in to post a comment.