# Inconsistency in Asymptotic expansion of cylindrical functions

Context

I am interested in asymptotic behaviour of Cylindrical functions which are solution to the differential equation

$$y''(x)+(x^2-1)y(x)=0\,.$$

I ask mathematica to find such solutions:

{s1, s2} =
List @@ DSolveValue[ y''[x] + (x^2 - 1)  y[x] == 0, y[x], x] /.
C[_] -> 1


and I then ask mathematica for the asymptotic behaviour of the first solution

tt = Asymptotic[s1, x -> Infinity]


which I can plot against the original solution

Plot[{s1,tt} // Re, {x, 1, 5}]


But most unexpectedly if I ask again for the expansion

tt = Asymptotic[s1, x -> Infinity]


Question

Can anyone reproduce what seems to be a strange bug?

I am using Mathematica 12.2.

Note that the new solution does not evaluate correctly.

• I used Series and both times got the same result and the same graph as you have. Notice, however, small misprint in your Plot. – yarchik Feb 12 at 17:00
• Plot[{Evaluate[ Re[AsymptoticDSolveValue[(-1 + x^2) y[x] + (y^\[Prime]\[Prime])[ x] == 0, y[x], {x, Infinity, 1}] /. {C[1] -> 1, C[2] -> 0}]], Evaluate[ Re[AsymptoticDSolveValue[(-1 + x^2) y[x] + (y^\[Prime]\[Prime])[ x] == 0, y[x], {x, Infinity, 1}] /. {C[1] -> 0, C[2] -> 1}]]}, {x, 2, 5}] producesthe same plots. – user64494 Feb 12 at 17:02
• @yarchik which version are you using? Because in my case it gives the (wrong) second expression. – chris Feb 12 at 17:44
• I can confirm the same behaviour in 12.1.0.0 – mmeent Feb 12 at 17:44
• I am using MA11.3 on mac – yarchik Feb 12 at 17:48

This is obviously a subtle bug.

Thanks to @J.M.'sennui's hint there is a (slower) workaround.

A solution is to FunctionExpand the ParabolicCylinderD before taking the Asymptotic

tt1 = Asymptotic[
s1 = ParabolicCylinderD[-(1/2) - I/2, (-1 + I) x] //
FunctionExpand, x ->\[Infinity]] // FunctionExpand //
FullSimplify;


Then after the plot

Plot[tt1 // Re, {x, 1, 5}];


the reevaluation

tt2 = Asymptotic[s1, x -> \[Infinity]] // FunctionExpand //
FullSimplify


yields the same result.

tt2 == tt1


(* True *)