5
$\begingroup$

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]

enter image description here

which I can plot against the original solution

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

enter image description here

But most unexpectedly if I ask again for the expansion

tt = Asymptotic[s1, x -> Infinity]

enter image description here

I get a different answer!

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.

$\endgroup$
10
  • 1
    $\begingroup$ I used Series and both times got the same result and the same graph as you have. Notice, however, small misprint in your Plot. $\endgroup$ – yarchik Feb 12 at 17:00
  • 1
    $\begingroup$ 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. $\endgroup$ – user64494 Feb 12 at 17:02
  • $\begingroup$ @yarchik which version are you using? Because in my case it gives the (wrong) second expression. $\endgroup$ – chris Feb 12 at 17:44
  • 1
    $\begingroup$ I can confirm the same behaviour in 12.1.0.0 $\endgroup$ – mmeent Feb 12 at 17:44
  • $\begingroup$ I am using MA11.3 on mac $\endgroup$ – yarchik Feb 12 at 17:48
2
$\begingroup$

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

enter image description here

yields the same result.

tt2 == tt1

(* True *)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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