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[1]:= Integrate[x E^(Sqrt[z^2]*x), x ] 2 x Sqrt[z ] Out[1]= Integrate[E x, x] (* Replace Sqrt with an arbitrary unknown function and it works fine... *) In[2]:= Integrate[x E^(f[z^2]*x), x ] 2 x f[z ] 2 -2 x Out[2]= E (-f[z ] + -----) 2 f[z ] (* Here is a brute force workaround *) In[3]:= Unprotect[Integrate] Out[3]= {Integrate} In[4]:= Integrate[x_ E^(a_ x_), x] := E^(a*x)*(-a^(-2) + x/a) /; FreeQ[a,x] In[5]:= Protect[Integrate] Out[5]= {Integrate} (* Now it can do the original integral *) In[6]:= %1 2 x Sqrt[z ] -2 x Out[6]= E (-z + --------) 2 Sqrt[z ] ...STeve ------------------------------------ Insert pithy maxim here... steve at tweedledee.ucsb.edu (NeXT mail)