       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:=
\$Version

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

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

Out=
0

In:= \$Version

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

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

Out= -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:= Simplify[Sqrt[1/Cos[t]^2]*3*Cos[t],
Assumptions -> 0 <= t < 2*Pi]

Out= 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:= Plot[Sqrt[1/Cos[t]^2]*3*Cos[t], {t, 0, 2 Pi}]

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

Out= 0

Regards,
--
Jean-Marc

```

• Prev by Date: Frequency response function