Using AsymptoticsTools

by W. Garrett Mitchener

First, you have to read in the definitions:

<< "Asymptotics.m"

(You might have to be more specific about where the file is, as in <<"C:\Stuff\Asymptotics.m" or <<"../Asymptotics.m".)

Here are the things defined in that file:

?From

From[x^2, {x, 1, 2}]

From[x Exp[-x],  {x, 0, Infinity}]

?ForcedByParts

For example: \(TraditionalForm\`∫\ \(e\^\(x\ t\)\) \(t\^2\) dt = \(\(1\/x\) \(∫∂\_t\ \((e\^\(x\ t\))\) \(t\^2\) dt\) = \(1\/x\) \((\(e\^\(x\ t\)\) 
                  t\^2)\) + ∫\(-\(\(2  
                        t\)\/x\)\)\ \(e\^\(x\ t\)\) dt\)\).  Here, u = (t^2)and v = (e^(x t)).

ForcedByParts[t^2, Exp[x t], t]

Bender and Orszag, section 6.3, example 2, p253:  We compute \(TraditionalForm\`∫\_x\%∞\( e\^\(-t\^4\)\) dt\) with v = (e^(-(t^4)))and u = 1.

ForcedByParts[1, Exp[-t^4], t]

manyTerms = ForcedByParts[1, Exp[-t^4], t, 4]

This throws away the derivative term (the last term in the list) leaving just the boundary terms:

manyTerms[[{1, 2, 3, 4}]]

The Map[From[...]...] applies the limits of the integral to each of the boundary terms.
The Apply[Plus,...] turns the list into a sum.

Apply[Plus, 
      Map[(From[#, {t, x, 
                Infinity}] &), 
manyTerms[[{1, 2, 3, 
              4}]]]]

The remainder is given by\(TraditionalForm\`∫\_x\%∞\(\( e\^\(-t\^2\)\)(3465\/\(256\ t\^16\))\) dt\), where the exponential is the v we've been using all along and the fraction is the remainder term from the long list.

?LaplaceTrialIntegral

Problem set 8, problem 2.  Solve this equation with an integral solution:

eq = x y''[x] + (7/8 - x) y'[x] - y[x]/4

Note that LaplaceTrialIntegral returns a function, so you have to call it with [x]:

yTrial = LaplaceTrialIntegral[m, f[t], t]

yTrial[x]

Substitute in the original equation:

eq /. y -> yTrial

We can acutally trick Mathematica into doing even more work for us:

ExpandAll[eq /. y -> yTrial]

We see that there are integrals with powers of m-1, m, and ,m+1, so we rig m to get rid of one of them in such a way that we only have to integrate by parts once later, which gives us a first order ODE for f instead of a second order one.  The easiest one to get rid of is the (x^(m - 1)), so we choose m as follows:

Solve[-1/8 m + m^2 == 0, m]

First, m=0:

y1 = LaplaceTrialIntegral[0, f[t], t]

Expand[eq /. y -> y1]

We convert all the \(TraditionalForm\`x \(∫□ d□\)\) terms into integrals by forcible integration by parts:

ForcedByParts[t f[t], Exp[t x], t]

ForcedByParts[t^2  f[t], Exp[t x], t]

The equation is trasformed into:

eq2=
-(1/4) ∫(E^(t x)) f[
                  t] \[DifferentialD]t+(7/8) ∫(E^(t x)) t f[
                  t] \[DifferentialD]t
-((E^(t x)) t f[t]+∫(E^(t x))(-f[t]-t f'[t])\[DifferentialD]t)
+((E^(t x)) (t^2) f[t]+∫(E^(t x))(-2 t f[t]-(t^2) f'[t])\[DifferentialD]t)

We now have integral terms of the form \(TraditionalForm\`\(∫e\^\(t\ x\) ... \) dt\)and boundary terms.  We pick f to make the integrand zero:

feq=(-1/4) f[t]+(7/8) t f[t]
-(-f[t]-t f'[t])+(-2 t f[t]-(t^2) f'[t])

DSolve[feq == 0, f, t]

Or more simply:

fSoln[t_] = (t - 1)^(-3/8) t^(-3/4)

Then, we pick the contour for the integral to make the boundary terms vanish.  In the end, t goes from 0 to 1 and it becomes conveniet to multiply by a factor of (((-1))^(-3/8))or something like that to keep f real-valued.  At any rate, that shows how to use the LaplaceTrialIntegral function.