2
$\begingroup$

I'm confused about the difference between Series and Asymptotic. Is there a good rule of thumb of when to use which?

Observations:

  • Asymptotic of order $n+1$ is analogous to Series to order $n$
  • Series generates constant terms

Code below uses both to simplify the following expression

$$\text{expr}=\frac{1}{\frac{s}{2}+\frac{\sqrt{2} \sqrt{s}}{\pi -2 \tan ^{-1}\left(\frac{\sqrt{s}}{\sqrt{2}}\right)}}$$

ClearAll["Global`*"];
expr = 1/(s/2 + (Sqrt[2] Sqrt[s])/(\[Pi] - 2 ArcTan[Sqrt[s]/Sqrt[2]]));
SF = StringForm;
series[order_] := Normal@Series[expr, {s, 0, order}];
asymp[order_] := Asymptotic[expr, {s, 0, order}];
{approxSeries, approxAsymp} = 
  Table[{i, #[i]}, {i, 0, 3}] & /@ {series, asymp};

visualize[approx_, label_] := (
  Print[TableForm[approx, TableHeadings -> {{}, {"order", "expr"}}]];
  LogLogPlot @@ {{expr}~Join~(Last /@ approx), {s, 0., .2},
    PlotLegends -> {"true"}~Join~(SF["order ``", First@#] & /@ approx),
    PlotStyle -> {{Thick, Opacity[.5]}, Automatic, Dashed, Dotted, 
      DotDashed},
    PlotLabel -> label}
  )
Quiet[visualize[approxSeries, "Series"]]
Quiet[visualize[approxAsymp, "Asymptotic"]]

enter image description here

enter image description here

$\endgroup$
6
  • $\begingroup$ Your code produces a warning "Asymptotic::aord: Approximation order specification 0 should be a positive integer or Infinity." omitted by you. $\endgroup$
    – user64494
    May 16 at 17:31
  • $\begingroup$ Also the question arises: what is the result without Quiets? $\endgroup$
    – user64494
    May 16 at 17:33
  • $\begingroup$ The constant in the result of Series follows from Limit[1/( s/2 + (Sqrt[2] Sqrt[s])/(\[Pi] - 2 ArcTan[Sqrt[s]/Sqrt[2]])) - \[Pi]/(Sqrt[2] Sqrt[s]), s -> 0 ] which results in -1 - \[Pi]^2/4. This term is not of importance for the asymptotic. $\endgroup$
    – user64494
    May 16 at 17:59
  • $\begingroup$ I've always wonder this myself too. I think 1. To avoid the SeriesData output and 2. Asymptotic generalizes Series in that it will give an expression asymptotic to the input. Series gives a (generalized) power series, and when this exists it's asymptotic to the input. Compare Asymptotic[PrimePi[x], {x, ∞, 3}] and Series[PrimePi[x], {x, ∞, 3}]. $\endgroup$
    – Greg Hurst
    May 17 at 15:29
  • 1
    $\begingroup$ Asymptotic is meant as a more powerful "superfunction". It can also handle, for example, inactivated operators (Asymptotic[Inactive[Integrate][Exp[x^2], x], x -> 0]). For a more detailed discussion about the peculiarities of implementation, I suggest watching Live CEOing Ep 279: Calculus & Algebra Features for WL 12.1. $\endgroup$
    – Domen
    May 17 at 16:16

1 Answer 1

5
$\begingroup$

The definition of Asymptotic can be accessed by GeneralUtilities`PrintDefinitionsLocal, and it seems that part of its code actually depends on Series.

For example, under the context Asymptotics`AsymptoticDump` , the dependency is like

Asymptotic>ccAsymptotic>iAsymptotic>UnivariateAsymptotic>UnivariatePowerSeries

and

Asymptotics`AsymptoticDump`UnivariatePowerSeries//GeneralUtilities`PrintDefinitionsLocal

gives

...
resser = SeriesCoefficient[f, {x, x0, n}]
...

This can also be seen by

On[Series::esss]
Block[{Quiet},
Asymptotic[Exp[-1/x], {x, 0, 1}]
]

enter image description here

and as suggested by @MichaelE2,

Trace[Asymptotic[Exp[-1/x],{x,0,1}],_Series,TraceInternal->True]

(*{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{Series[x,{x,0,1}]}}}}}}}}}}}}}},{{{{{{{Series[E^(-1/x),{x,0,1}]}}}}}}}}}}}}}}}}}}}}}}}}}}*)
$\endgroup$
9
  • $\begingroup$ How do you explain the difference between Asymptotic[Log[a*x], {x, Infinity, 2}, Assumptions -> a > 0] which results in Log[a x] and Series[Log[a*x], {x, Infinity, 2}, Assumptions -> a > 0] // Normal which outputs Log[a] + Log[x] (in 13.2.1)? $\endgroup$
    – user64494
    May 16 at 19:04
  • $\begingroup$ @Lacia, The series commands may also be seen in Trace[ Asymptotic[Exp[-1/x], {x, 0, 1}], _Series, TraceInternal -> True] $\endgroup$
    – Michael E2
    May 17 at 0:26
  • $\begingroup$ @user64494 maybe because there are lots of conditions and preprocess before SeriesCoefficient in the code of Asymptotic. $\endgroup$
    – Lacia
    May 17 at 5:44
  • $\begingroup$ @MichaelE2 yes, I agree. It surprises me that the source code of Asymptotic is not fully protected. $\endgroup$
    – Lacia
    May 17 at 5:45
  • $\begingroup$ @Lacia: Sorry, I dislike speculations. Trace[Asymptotic[Log[a*x], {x, 0, 1}, Assumptions -> a > 0], _Series, TraceInternal -> True] results in {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{Series[x,{x,0,1}]}}}}}}}}}}}}}},{{{{{{{Series[Log[a x],{x,0,1}]}}}}}}}}}}}}}}}}}}}}}}}}}} suggesting that no assumption is taken into account. $\endgroup$
    – user64494
    May 17 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.