Menu

#3078 bad result of integrate(1/cos(x),x) and integrate(1/sin(x),x)

None
closed
nobody
1
2016-01-24
2016-01-22
lanride
No

integrate(1/cos(x),x) gives log(sin(x)+1)/2-log(sin(x)-1)/2 and
integrate(1/sin(x),x) gives log(cos(x)-1)/2-log(cos(x)+1)/2
in both cases sin(x)-1<0 and cos(x)-1<0 and undefined for log().
Correct values should be 1-sin(x) and 1-cos(x).

Discussion

  • Jaime E. Villate

    You're restricting yourself to the real domain, while Maxima is working in the complex domain. The configuration variable logabs allows you to get the results you expected:

    (%i7) logabs:true$
    
    (%i8) integrate(1/cos(x),x);
                log(abs(sin(x) + 1))   log(abs(sin(x) - 1))
    (%o8)       -------------------- - --------------------
                         2                      2
    
     

    Last edit: Jaime E. Villate 2016-01-22
  • David Scherfgen

    David Scherfgen - 2016-01-24
    • status: open --> closed
     

Log in to post a comment.