MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Bug of Integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82725] Re: Bug of Integrate
  • From: "David W.Cantrell" <DWCantrell at sigmaxi.net>
  • Date: Tue, 30 Oct 2007 03:20:57 -0500 (EST)
  • References: <fg4dfv$6c3$1@smc.vnet.net>

Miguel <misvrne at gmail.com> wrote:
> When I try to calculate the integral
>
> Integrate[Sqrt[1/Cos[t]^2]*3*Cos[t],{t,0,2Pi}]  Mathematica 6.0.1
> yields -6*Pi.

If so, then that is clearly a bug. But in version 5.2, the result is
correct:

In[1]:= Integrate[Sqrt[1/Cos[t]^2]*3*Cos[t],{t,0,2Pi}]

Out[1]= 0

> Simplifying the expresion resultrs Integrate[3,{t,0,2*Pi}] and It is
> clear that the correct solution is 6*Pi.

No. Simplifying the integrand does not give 3, rather

In[2]:= Simplify[Sqrt[1/Cos[t]^2]*3*Cos[t], Element[t,Reals]]

Out[2]= 3 Abs[Sec[t]] Cos[t]

which BTW is the same as 3 Sign[Cos[t]] for real t except when Cos[t]==0.

However, related to the above, version 5.2 does give an incorrect result
for a definite integral with a symbolic real limit. Whether this error
still exists in version 6, I don't know:

In[3]:= Assuming[Element[x,Reals],Integrate[3*Sign[Cos[t]],{t,0,x}]]

Out[3]= 3 If[x > 0, x Abs[Cos[x]] Sec[x],
Integrate[Sign[Cos[t]], {t, 0, x}, Assumptions -> x <= 0]]

The above is incorrect for x > Pi/2. A correct result would have been

3 Sign[Cos[x]] (x - Pi Floor[x/Pi + 1/2])

for all real x.

David W. Cantrell


  • Prev by Date: Re: Bug of Integrate
  • Next by Date: Re: Transparent background in Mathematica 6?
  • Previous by thread: Re: Bug of Integrate
  • Next by thread: Re: Bug of Integrate