MathGroup Archive 1995

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

Search the Archive

Re: Peculiar behavior of Integrate

  • To: mathgroup at
  • Subject: [mg2668] Re: Peculiar behavior of Integrate
  • From: withoff (David Withoff)
  • Date: Sun, 3 Dec 1995 02:55:17 -0500
  • Organization: Wolfram Research, Inc.

In article <49jdro$53i at> bruck at (Ronald  
Bruck) writes:
> Can anyone explain this to me?  This comes from Problem G.1.b.iii of  
> set 2.03 of Davis, Porta and Uhl's Calculus and Mathematica:
> If I execute
> Clear[t,T]
> 100 + Integrate[(160 E^t)/(0.5 + E^t)^2,{t,0,T}]
> %/.T->2400
> Mathematica does it in a wink.  If I execute
> Clear[t,T]
> 100 + Integrate[(160 E^t)/(1/2 + E^t)^2,{t,0,2400}]
> Mathematica does it quick as a wink.  (This is on a Power Mac 9500/132;
> your winks may vary.)
> But if I execute
> Clear[t,T]
> 100 + Integrate[(160 E^t)/(0.5 + E^t)^2,{t,0,2400}]
> then Mathematica grinds away... and grinds away... and so far I haven't  
> the patience to outwait it.  When I interrupt the kernel it takes almost  
> minute to back out of whatever it's doing.
> What's it doing?  Is this some local user-preference which is causing  
> Can anyone verify similar behavior on other platforms?
> This is Mathematica for the Power Macintosh (the  
> cation-but-fix version).
> I asked the student whether she had made the proper propitiary  
> before sitting down at the computer, and she swore she had ;-)
> --Ron Bruck

The Integrate function computes this integral by taking limits
of the corresponding indefinite integral.  The Limit function
calls Simplify, which in turn calls FactorSquareFree on the
expressions 0.5 + E^2400, which is treated as a polynomial of
degree 2400 in the variable E.  This expression has 2400 factors,
and factoring it will probably take longer than you want to wait.

Since all of these operations are perfectly reasonable, and usually
desirable, fixing this particular example is not easy.  It has
nevertheless been fixed for the next version of Mathematica.

You can demonstrate that this is what is happening by disabling
Simplify while doing the integral.

In[1]:= Block[{Simplify},
            Simplify[p_] := p;
            Integrate[(160 E^t)/(0.5 + E^t)^2,{t,0,2400}]

Out[1]= 106.667 - -----------
                  0.5 + E

When the inexact number 0.5 is replaced by 1/2, there is no problem,
since the result is irreducible, and Factor quits immediately.
Inexact numbers are problematic and should be avoided in this type
of calculation anyway, for fundamental mathematical reasons unrelated
to Mathematica.

Dave Withoff
Wolfram Research

  • Prev by Date: Extremely simple problem, and NO success!
  • Next by Date: Re: Q> on COMBINING PLOTS w/ diff. axes. (LONG)
  • Previous by thread: Re: Peculiar behavior of Integrate
  • Next by thread: Re: [Q] how fast is each machine with Mathematica ?