       bug in integration with version 5.0 ?

• To: mathgroup at smc.vnet.net
• Subject: [mg46453] bug in integration with version 5.0 ?
• From: "Florian Jaccard" <florian.jaccard at eiaj.ch>
• Date: Thu, 19 Feb 2004 03:02:03 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Hello Users !

I have the following problem :

If I integrate

1/(2x^2 + 8x + 20)

with version  4.1 , I obtain the same answer as by hand:

ArcTan[(2 + x)/Sqrt]/(2*Sqrt)

Today, I was teaching with the version 5.0, and I obtained :

In:=
expr = Integrate[1/(2*x^2 + 8*x + 20), x]

Out=
(I*(Log[-2*I + Sqrt - I*x] -
Log[2*I + Sqrt + I*x]))/(4*Sqrt)

It is not as nice as with the version 4.1, but it is right too !

Let us check  :

In:=
Simplify[ComplexExpand[expr,TargetFunctions->{Re,Im}]]

Out=
ArcTan[(2 + x)/Sqrt]/(2*Sqrt)

One of my students suggested to load the RealOnly package. He hoped that the
answer would not have a complex form. I just wanted to show him that it
would not be better, and tried his suggestion :

In:=
<< "Miscellaneous`RealOnly`"

In:=
Integrate[1/(2*x^2 + 8*x + 20), x]

Out=
x/(2*(x^2 + 4*x + 10))

This is completely wrong, for sure !

Curiosly, with version 4.1, with RealOnly loaded, Mathematica gives the
right answer... Is it a ugly bug of version 5 ?
Should I tell my students not to use RealOnly ?