MathGroup Archive 2012

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

Search the Archive

Re: V8 slow like a snail

Am 21.08.2012 03:39, schrieb Dr. Wolfgang Hintze:

>>>>> Consider this integral for which we can safely expect Mathematica to
>>>>> be expert in solving:
>>>>> f1[n_, m_] :=
>>>>>     Integrate[n t^m Exp[-n t] (Exp[t] - 1)^(n - 1), {t, 0, \[Infin=
> ity]},
>>>>>      Assumptions -> {{n, m} \[Element] Integers, m >= 0, n > 0}]
>>>>> I carried out Timing[f1[n, m]] for m=0,1,2,3,10 in both versions. H=
> ere
>>>>> are the results in the format

>> But compare your results with thos after the standard substitution
>> exp(-t) ->u, t->-Log[u], dt -> -du/u  {t,0,oo}-> {u,0,1}
>> h1[n_, m_] :=
>>    Integrate[n (-Log[u])^m  (1 - u)^(n - 1), {u, 0, 1},
>>     Assumptions -> {{n} \[Element] Integers, n > 0}]

> I'm well aware of how to handle Mathematica i.e. to help it get to
> results (since 2003 in this group).
> However, as a conservative software user this was my first version
> change in Mathematica, and I didn't expect the differences be so grave
> when simply comparing the same commands.
> Your substitution is so obvious that exactly for this reason one could
> possibly expect Mathematica to do it by itself. But ok, in this form
> the integration in V8 is quick.
> And after all, one of the charming features of Mathematica is just the
> "human-like" behaviour to sometimes failing but with some help finally
> reaching the goal.

At least you found a real bug in vs 8.

Mathematica uses generalized hypergeometric series to express a wide 
class of integrals containing Pochhammer symbols wich arise in partial 
integration of expression(x)^n.
But some of these series dont work for integer parameters or need 
special regularizations by Gamma factors.

In this case the indefinite integrals over the variable t are expressed 
in terms of

HypergeometricPFQ[{-n,-n...},{1-n,1-n,...},, e^t]

Mathematica is not able to determine Limits for t->0 and t->oo. Moreover 
these special hypergeometric series even seem to have no limits for 
integer n.

So I suspect the time is vasted for determining the limits for real 
noninteger n (Limit takes some 50-100 seconds to retun no result) and 
after failing the standard substituition list is applied.

The general integration rule complex for "algebraic expression of powers 
and exponentials" seems to miss a preprocessing for the exception of 
integer n and m.


Roland Franzius

  • Prev by Date: Re: Drawing a Line From One Plot to Another
  • Next by Date: trouble with NDSolve: how to diagnose a problem with initial conditions?
  • Previous by thread: Re: V8 slow like a snail
  • Next by thread: working with nested lists