FW: [ maxima-Bugs-1051437 ] Trig integral error



The source code is probably in the file sin or sinint.

Start by tracing some of those main functions.
It is possible the error is in the patterns matched/replaced
by m1 or m2.

It might also be useful to know that commercial macsyma returns

log(sin^2(x) + cos^2(x) + 2 * cos(x) + 1)
   + log(sin^2(x) + cos^2(x) - 2 * cos(x) + 1)

which after using trigreduce and logcontract and trigsimp
becomes
log(sin^2(x)) + cos(2 * x) + 2 * log(2)

But then 2*log(2) is a constant and can be removed.
and so in a few more steps I get

log(sin^2(x)) - 2 * sin^2(x)

which seems to do it.

Cheers



Billinghurst, David (CALCRTS) wrote:

> This bug is annoying me enough to want to try and fix it.  
> Any thoughts on where to start looking?
> 
> Bugs item #1051437, was opened at 2004-10-21 22:21
> Message generated for change (Comment added) made by billingd
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1051437&group_id=4933
> 
> Category: None
> Group: None
> Status: Open
> Resolution: None
> Priority: 5
> Submitted By: David Billinghurst (billingd)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: Trig integral error
> 
> Initial Comment:
> The integral of
>    2*COT(x)^2*COS(2*x)/(CSC(2*x)+COT(2*x));
> is wrong for maxima-5.9.1
> 
> (%i1) display2d:false;
> (%o1) FALSE
> (%i2) h: 2*COT(x)^2*COS(2*x)/(CSC(2*x)+COT(2*x));
> (%o2) 2*COT(x)^2*COS(2*x)/(CSC(2*x)+COT(2*x))
> (%i3) ih:integrate(h,x);
> (%o3) (2*LOG(SIN(x)^2+COS(x)^2+2*COS(x)+1)
> +2*LOG(SIN(x)^2+COS(x)^2-2*COS(x)+1)
>                                           +COS(2*x))
>        /2
> (%i4)  ev(ih,x=1.0,numer)-ev(ih,x=0.5,numer);
> (%o4) .6469013090248041
> (%i5) quad_qags(h,x,0.5,1);
> (%o5) [.1686767378171631,3.37999776996994E-
> 15,21,0]
> (%i6) h2:trigsimp(trigexpand(h));
> (%o6) (4*COS(x)^3-2*COS(x))/SIN(x)
> (%i7) ih2:integrate(h2,x);
> (%o7) LOG(COS(x)+1)+LOG(COS(x)-1)+2*COS(x)^2
> (%i8)  ev(ih2,x=1.0,numer)-ev(ih2,x=0.5,numer);
> (%o8) .1686767378171636
> 
> The integral over 0.5 < x < 1.0 at %o4 differs from the 
> numerical integral %o5 and the analytic integral of an 
> equivalent expression %o8.
> 
> Once this is fixed, activate equation (22) in 
> share/contrib/diffequations/tests/rtestode_murphy1.mac
> 
> 
> NOTICE
> This e-mail and any attachments are private and confidential and may contain privileged information. If you are not an authorised recipient, the copying or distribution of this e-mail and any attachments is prohibited and you must not read, print or act in reliance on this e-mail or attachments.
> This notice should not be removed.
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima