       Integrate bug and workaround

• To: mathgroup at christensen.cybernetics.net
• Subject: [mg1050] Integrate bug and workaround
• From: Steven Trainoff <steve at borglet.ucsb.edu>
• Date: Wed, 10 May 1995 09:05:38 -0400

```Hello all,

I am constantly amazed at how fickle MMA's integrator is.  Perhaps
this example is well known, but it sure surprised me.  Can anyone
explain this behaviour, or is it a simple bug?  I am running MMA
version "NeXT 2.0 (November 14, 1991)"

(* It can't do this... *)

In:= Integrate[x E^(Sqrt[z^2]*x), x ]

2
x Sqrt[z ]
Out= Integrate[E           x, x]

(* Replace Sqrt with an arbitrary unknown function and it works
fine... *)

In:= Integrate[x E^(f[z^2]*x), x ]
2
x f[z ]      2 -2     x
Out= E        (-f[z ]   + -----)
2
f[z ]

(* Here is a brute force workaround *)
In:= Unprotect[Integrate]

Out= {Integrate}

In:= Integrate[x_ E^(a_ x_), x] := E^(a*x)*(-a^(-2) + x/a) /;
FreeQ[a,x]

In:= Protect[Integrate]

Out= {Integrate}

(* Now it can do the original integral *)
In:= %1

2
x Sqrt[z ]    -2      x
Out= E           (-z   + --------)
2
Sqrt[z ]

...STeve
------------------------------------
Insert pithy maxim here...
steve at tweedledee.ucsb.edu (NeXT mail)

```

• Prev by Date: Re: Re: Summary:Ways to get Odd Columns&Rows of Matrix
• Next by Date: How to solve system of iinequalities?
• Previous by thread: Re: Re: Summary:Ways to get Odd Columns&Rows of Matrix
• Next by thread: Re: Integrate bug and workaround