Re: Bug? Analytical integration of cosines gets the sign wrong
- To: mathgroup at smc.vnet.net
- Subject: [mg107182] Re: Bug? Analytical integration of cosines gets the sign wrong
- From: "Norbert P." <bertapozar at gmail.com>
- Date: Fri, 5 Feb 2010 03:20:09 -0500 (EST)
- References: <hkeb9k$b5$1@smc.vnet.net>
Not sure what's going on,
but I' m getting the same thing on 7.0.1 on Win32:
In[1] :=
Integrate[Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph], {ph, Pi, 3/2*Pi}]
Out[1] = 19/(105 \[Pi])
But the indefinite integral is correct:
In[2] :=
Integrate[Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph],
ph] /. {{ph -> 3/2 Pi}, {ph -> Pi}}
Out[2] = {-(19/(105 \[Pi])), 0}
In[3] := D[Integrate[Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph], ph], ph] ==
Cos[ph]*1/Pi*Cos[4*ph]*Cos[2*ph] // FullSimplify
Out[3] = True
Best,
Norbert
On Feb 4, 3:33 am, K <kgs... at googlemail.com> wrote:
> 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.