MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Need a better Integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42976] Need a better Integrate
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Thu, 7 Aug 2003 00:53:34 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

A user sent me an email with an interesting problem.  See below.
 
In[1]:=  deriv = D[(-5 + x^2)^4/8, x]
 
Out[1]= x*(-5 + x^2)^3
 
 
In[2]:=  int = FullSimplify[Integrate[x*(-5 + x^2)^3, x]];
 
Out[2]= (x^2*(-10 + x^2)*(50 - 10*x^2 + x^4))
 
 
Why doesn't FullSimplify return  (-5 + x^2)^4/8  which is simpler?
It doesn't because the expression Integrate returned is different from 
(-5 + x^2)^4/8  by 625/8.  Of course both answers are correct because the 
result of an indefinite integral includes an arbitrary constant.  However, 
Mathematica never includes the constant in the result Integrate returns.  
In the next line we get the result we expected above.
 
In[3]:=  Factor[int + 625/8]
 
Out[3]= (-5+x^2)^4/8
 
 
I wonder if somebody can figure out how to define a better integrate that 
would do the following:
 
MyIntegrate[f_,x_]:= FullSimplify[Integrate[f,x]+const]
  (* Through some clever algebra find the value of (const) that will give
the simplest answer. *)
 
 
We would then get:
In[4]:= MyIntegrate[x*(-5 + x^2)^3, x] 
 
Out[4]= (-5+x^2)^4/8
 
 
-------------------
Regards,
     Ted Ersek
 


  • Prev by Date: Re: Dealing with large data sets
  • Next by Date: "Mathematica was unable to open the file . . . "
  • Previous by thread: package testers wanted
  • Next by thread: Re: Need a better Integrate