Re: AiryAi
- To: mathgroup at smc.vnet.net
- Subject: [mg75601] Re: AiryAi
- From: Roman <rschmied at gmail.com>
- Date: Sun, 6 May 2007 01:51:43 -0400 (EDT)
- References: <f1hlg0$p7q$1@smc.vnet.net>
Dimitris, The Airy function has terrible convergence: for x -> -Infinity, you have, to very good accuracy, AiryAi[x] ~~ Sin[Pi/4 - (2*Sqrt[-x]*x)/3]/(Sqrt[Pi]*(-x)^(1/4)) Just plot the two; they differ by very little for x < -20 or so. Let's call f[x] the approximation. So you have an oscillatory function decreasing as slowly as (- x)^(-1/4). Numerically integrating this requires adding an infinity of terms of alternating signs (the integrals over the positive and negative sine arcs, respectively), which have to very delicately cancel out in order to produce a small result. The reason why this cancellation only works analytically but not numerically in this case is that while f[x] is integrable over (-Infinity,0], its square f[x]^2 is not. This is like the classical calculus example of a series that is convergent but not absolutely convergent, giving rise to numerical hell. The sum of all the positive terms is +Infinity, and the sum of all negative terms is -Infinity, but the total sum of all terms (the integral) is 2/3 (or Sqrt[2/3] for f[x]). Maybe you remember from calculus class that by re-ordering the terms in such a series you can get any final result you desire, i.e., the result of numerically integrating will depend very much on how you integrate (which is bad), so I'm not sure that in practice you could ever get a numerical integral of your Airy function without analytical insights. Another way of seeing the problem is that as the numerical integration progresses from 0 backward to -Infinity, the resulting integral may well converge in theory, but the estimated numerical error increases the longer we integrate, instead of decreasing or stabilizing as is required for a well-determined result. Roman. On May 5, 12:15 pm, dimitris <dimmec... at yahoo.com> wrote: > Hello. > > Consider the integral > > In[678]:= > f = HoldForm[Integrate[AiryAi[o], {o, a, b}]] > > Then > > In[679]:= > {ReleaseHold[f /. {a -> 0, b -> Infinity}], (Rationalize[#1, 10^(-12)] > & )[ > ReleaseHold[f /. Integrate -> NIntegrate /. {a -> 0, b -> > Infinity}]]} > > Out[679]= > {1/3, 1/3} > > Hence, the symbolic and the numerical result agree. > > Next, > > In[682]:= > ReleaseHold[f /. {a -> -Infinity, b -> 0}] > N@% > > Out[682]= > 2/3 > Out[683]= > 0.6666666666666666 > > I think I can trust the last analytic result. > > However, no matter what options I set for NIntegrate, I could get a > satisfactory > result from its application for the integral in (-infinity,0]. > > I really appreciate any help. > > Thanks > Dimitris