Re: Bug? Analytical integration of cosines gets the sign wrong
- To: mathgroup at smc.vnet.net
- Subject: [mg107178] Re: [mg107168] Bug? Analytical integration of cosines gets the sign wrong
- From: "David Park" <djmpark at comcast.net>
- Date: Fri, 5 Feb 2010 03:19:26 -0500 (EST)
- References: <30308427.1265284507356.JavaMail.root@n11>
It looks like a bug. Also if we evaluate using the indefinite Integrate and
LimitsBracket we obtain the minus sign.
Needs["Presentations`Master`"]
LimitsBracket[
Integrate[(Cos[ph] Cos[4 ph] Cos[2 ph])/\[Pi], ph], {ph, \[Pi],
3 \[Pi]/2}]
% // EvaluateLimitsBracket
[(2 Sin[ph]+2/3 Sin[3 ph]+2/5 Sin[5 ph]+2/7 Sin[7 ph])/(8 \[Pi])](3 \[Pi])/2
\[Pi] (* which displays as a conventional textbook limits bracket
expression *)
-(19/(105 \[Pi]))
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/
From: K [mailto:kgspga at googlemail.com]
Hello everyone,
the analytical integration in Mathematica 7.01.0 on Linux x86 (64bit)
faultyInt =
Integrate[Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph], {ph, Pi, 3/2*Pi}]
gives as result:
19/(105 \[Pi])
which is as a decimal number
N[faultyInt]
0.0575989
The numerical integration
NIntegrate[Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph],{ph,Pi,3/2*Pi}]
gives
-0.0575989
which I believe is correct by judging from the plot
Plot[Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph], {ph, Pi, 3/2*Pi},
PlotRange -> {-1/Pi, 1/Pi}]
and because the quadgk function in another system gives the same
negative result. Could anyone try this at home (or work, rather)
and confirm or disprove it?
Thanks,
K.