MathGroup Archive 1997

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

Search the Archive

Re: Strange timing behavior of Integrate[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8457] Re: [mg8341] Strange timing behavior of Integrate[]
  • From: "C. Woll" <carlw at u.washington.edu>
  • Date: Sat, 30 Aug 1997 00:43:11 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Carlos,

I don't have any additional comments on timing behavior, but as far as
your integral is concerned, have you considered that for n,m even:

Integrate[Sin[phi]^n Cos[phi]^m,{phi,0,2 pi}] is 2 Beta[(n+1)/2,(m+1)/2]

and for n or m odd, the above integral vanishes?

Carl Woll
Dept of Physics
U of Washington

On Tue, 26 Aug 1997, Carlos A. Felippa wrote:

>  I am doing an acoustic radiation study with Mma 3.0 in which I have to
>  evaluate thousands of trigonometric integrals of the form sin[phi]^m*cos[phi]^n
>  over 0->2 Pi for a wide range of integers m and n.  I noticed that some
>  combinations took enormous times to evaluate forcing aborts.
> 
>  I traced it to the phenomenon exemplified by the equivalent commands
> 
>  Print [Integrate[(a+b)^12*Cos[phi]^8*Sin[phi]^8,{phi,0,2*Pi}]//Timing];
>  Print [(a+b)^12*Integrate[Cos[phi]^8*Sin[phi]^8,{phi,0,2*Pi}]//Timing];
> 
>  The result is obviously the same.  However, On a Mac 8500/120,
>  the first form takes 4.85 seconds while the second completes in 0.53 Seconds.
>  For more complex factors the time ratio may reach into the thousands.
> 
>  What is going on?  It seems as if Integrate[] cannot identify invariant
>  expressions.
> 
> 
> 
> 



  • Prev by Date: Fitting data to an ellipse or circle??
  • Next by Date: Comparison of Mathematica on Various Computers
  • Previous by thread: Re: Strange timing behavior of Integrate[]
  • Next by thread: Bra-Ket