Re: Bug of Integrate

• To: mathgroup at smc.vnet.net
• Subject: [mg82731] Re: Bug of Integrate
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Tue, 30 Oct 2007 03:24:02 -0500 (EST)
• Organization: The Open University, Milton Keynes, UK
• References: <fg4dfv\$6c3\$1@smc.vnet.net>

```Miguel 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.

Mathematica 5.2 and 6.0.1 disagree here, though the result returned by
5.2 is correct.

In[1]:=
\$Version

Out[1]=
5.2 for Microsoft Windows (June 20, 2005)

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

Out[2]=
0

In[1]:= \$Version

Out[1]= "6.0 for Microsoft Windows (32-bit) (June 19, 2007)"

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

Out[2]= -6 \[Pi]

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

Erroneous simplification on the interval [0, 2Pi): this is valid only
for t between 0 and Pi/2 and t between 3Pi/2 and 2Pi (otherwise the
cosine is negative). The correct simplification is as below:

In[1]:= Simplify[Sqrt[1/Cos[t]^2]*3*Cos[t],
Assumptions -> 0 <= t < 2*Pi]

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

> Is a bug of Version 6.0.1?

It looks like that neither Mathematica 6.0.1 nor you were correct :-)
The correct result, zero, is returned by version 5.2.

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

In[4]:= Integrate[3 Abs[Sec[t]] Cos[t], {t, 0, 2 Pi}]

Out[4]= 0

Regards,
--
Jean-Marc

```

• Prev by Date: Frequency response function