MathGroup Archive 2006

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

Search the Archive

simple timing question

  • To: mathgroup at
  • Subject: [mg69920] simple timing question
  • From: dimmechan at
  • Date: Wed, 27 Sep 2006 06:05:25 -0400 (EDT)


Consider the following user defined function to calculate integrals
possible singulaties at the end points

improperIntegrate[f_, x_, a_, b_] := With[{integral = Integrate[f, x]},
x -> b, Direction -> 1] - Limit[integral, x -> a, Direction -> -1]]


Timing[improperIntegrate[1/(2*x - 1)^(2/3), x, 1/2, 3]]
{0.07800000000000001*Second, (3*5^(1/3))/2}

Using directly Integrate almost 5 times more time is neeeded.

Timing[Integrate[1/(2*x - 1)^(2/3), {x, 1/2, 3}]]
{0.406*Second, (3*5^(1/3))/2}

For me it sounds normally that Integrate needed more time.
However I am looking for a clear explanation if possible.

I believe it has to do that using directly Integrate much time is spent
for checking
for singularities (here 1/2). Am I right or/and there is another

Thanks in advance.

  • Prev by Date: Re: How to remove just the outermost braces of a list?
  • Next by Date: RE: Mapping Functions That Take More Than One Argument
  • Previous by thread: Re: Executing function in mathematica function problem
  • Next by thread: Re: simple timing question