Re: Extending Integrate[]

*To*: mathgroup at smc.vnet.net*Subject*: [mg87764] Re: Extending Integrate[]*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Wed, 16 Apr 2008 07:17:30 -0400 (EDT)*Organization*: Uni Leipzig*References*: <fu4lnj$si9$1@smc.vnet.net>*Reply-to*: kuska at informatik.uni-leipzig.de

Hi, for a new integration rule, give always the most general pattern, i.e. in your case Unprotect[Integrate] Integrate[d_. + c_.*Sin[Sin[a_. + b_. x_]], x_] := c*Jones[a, x]/b + Integrate[d, x] /; FreeQ[c, x] and all works fine. Regards Jens Szabolcs Horv=E1t wrote: > According to the documentation it is possible to extend Integrate[] wit= h > new rules: > > http://reference.wolfram.com/mathematica/tutorial/IntegralsThatCanAndCa= nnotBeDone.html > > The specific example that is given is: > > Unprotect[Integrate] > > Integrate[Sin[Sin[a_. + b_. x_]], x_] := Jones[a, x]/b > > Now Integrate[Sin[Sin[3x]], x] will return Jones[0, x]/3 > > But if I try an integrand that is just slightly more complicated, > Mathematica returns it unevaluated: > > In[21]:= Integrate[a + Sin[Sin[x]], x] > Out[21]= Integrate[a + Sin[Sin[x]], x] > > My question is: Is it really possible to extend Integrate in an > intelligent way? The above example seems to be just simple pattern > matching. It would work with any function, not just Integrate[]. Ther= e > is nothing new or surprising about it. > > But is it *really* possible to extend Integrate[] with new definitions > in a way that Mathematica will use these rules when calculating more > complicated Integrals? > > If (as I suspect) it is not possible to do this, then the documentation= > is a bit misleading ... >