Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Re: Evaluating integral with varying upper limit?

Carl Woll wrote:

>AES wrote:
>>Given a function  f[x]  which happens to be rather messy and not 
>>analytically integrable, I want to evaluate the function
>>  g[y_] := NIntegrate[f[x], {x, ymin, y} ]
>>with ymin fixed and  ymin < y < Infinity.  
>>I suppose that FunctionInterpolate is the way to go here (???).
>>But, are there tricks to tell FunctionInterpolate what I know in 
>>advance, namely that f[x] is everywhere positive, and decreases toward 
>>zero rapidly enough at large x that g[y] will approach a finite limiting 
>>value as y -> Infinity? (which value I'd like to have FI obtain with 
>>moderate accuracy -- meaning 3 or 4 significant digits, not 10 or 20)
>>Thanks . . .
>I would recommend using NDSolve to invert the NIntegrate operation, 
>although handling the range ymin<y<Infinity is problematic. For example:
>Then, using NDSolve we have:
>NDSolve[{h'[x] == f[x], h[1] == 0}, h, {x, 1, 100}]
>{{h -> InterpolatingFunction[{{1., 100.}}, <>]}}
>A few checks:
>h[10] /. %5[[1]]
>h[100] /. %5[[1]]
>If you really need an InterpolationFunction whose range is ymin to 
>Infinity, then you can try transforming variables, like y->1/y, but 
>getting NDSolve to handle the point at Infinity (or 0 in transformed 
>coordinates) becomes difficult.
>Carl Woll
>Wolfram Research
A colleague of mine suggested using y->Tan[y] as a transformation 
function instead of y->1/y, and this works much better for my example:


nds = NDSolve[{1/Tan'[z] ht'[z] == f[ Tan[z] ], ht[ArcTan[1]] ==0}, ht, 
{z, ArcTan[1], Pi/2} ][[1]]

With[{ht = ht /. nds},
  h[x_] := ht[ ArcTan[x] ]

and some checks:



Carl Woll
Wolfram Research

  • Prev by Date: RE: Plotting multi-column data
  • Next by Date: Re: Efficiency of repeatedly appending to a List
  • Previous by thread: Re: Evaluating integral with varying upper limit?
  • Next by thread: Re: Evaluating integral with varying upper limit?