# How to convert solution from ParabolicCylinderD to Bessel functions?

I am trying to verify my hand solution to an ODE. The solution I got is in terms of Bessel functions. Maple gives same solution.

Mathematica gives the solution in terms of ParabolicCylinderD which I have not used before and not familiar with.

I am assuming both solutions are Mathematically equivalent.

But I am not able to transform the solution from ParabolicCylinderD to Bessel function. I tried FunctionExpand and tried MeijerGReduce but no luck.

ode = y''[x] + x^2 *y[x] == 0;
sol = DSolve[ode, y[x], x]


While in Maple

This is what I tried in Mathematica

 FunctionExpand[sol]


 MeijerGReduce[FunctionExpand[sol], x]


And I do not know what to do next. Any suggestions?

Mathematica 12.0 on windows 10.

https://reference.wolfram.com/language/ref/ParabolicCylinderD.html

\$Version

(* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *)

Clear["Global*"]

ode = y''[x] + x^2*y[x] == 0;

sol = DSolve[ode, y, x][[1]]

(* {y -> Function[{x},
C[2] ParabolicCylinderD[-(1/2), (-1 + I) x] +
C[1] ParabolicCylinderD[-(1/2), (1 + I) x]]} *)


Verifying that sol satisfies ode

ode /. sol // FullSimplify

(* True *)

y1[x_] = y[x] /. sol;


The Maple solution you gave is

y2[x_] = C[3] Sqrt[x] BesselJ[1/4, x^2/2] +
C[4] Sqrt[x] BesselY[1/4, x^2/2];


Verifying that y2 satisfies the ode

ode /. y -> y2 // FullSimplify

(* True *)


Equate the functions (y1 and y2) and their derivatives at x = 0 to find the relations between the arbitrary constants.

const = Solve[{
(Limit[y1[x], x -> 0, Direction -> "FromAbove"] // Simplify) ==
Limit[y2[x], x -> 0, Direction -> "FromAbove"],
(y1'[0] // Simplify) ==
(Limit[y2'[x], x -> 0, Direction -> "FromAbove"] // FullSimplify)},
{C[1], C[2]}][[1]] // FullSimplify

(* {C[1] -> -((2^(1/4) (C[3] + (2 - I) C[4]))/Sqrt[π]),
C[2] -> (2^(1/4) (C[3] - I C[4]))/Sqrt[π]} *)


Rewriting the arbitrary constants in y1

y3[x_] = (y1[x] /. const // FunctionExpand // FullSimplify)

(* Sqrt[x] (-Sqrt[2] BesselJ[-(1/4), x^2/2] C[4] +
BesselJ[1/4, x^2/2] (C[3] + C[4])) *)


Verifying that y3 satisfies the ode

ode /. y -> y3 // FullSimplify

(* True *)


y3 expresses the solution in terms of Bessel functions although in a slightly different form than that provided by Maple.

EDIT: Verifying that y2 and y3 are equal

y2[x] == y3[x] // FullSimplify

(* True *)


Here's a way to see the solution in Bessel function format:

Simplify[FunctionExpand[Activate[MeijerGReduce[FunctionExpand[
DSolveValue[y''[x] + x^2 y[x] == 0, y[x], x], x]]]]]
((-1 - I) Sqrt[2 π] x BesselJ[1/4,x^2/2] (C[1] + I C[2]) +
2 Sqrt[π] Sqrt[x^2] BesselJ[-(1/4), x^2/2] (C[1] + C[2]))/(2 2^(3/4) (x^2)^(1/4))

Collect[%, _C, FullSimplify @* FunctionExpand @* FullSimplify]
(Sqrt[π] Sqrt[x] (Sqrt[2] BesselJ[-(1/4), x^2/2] -
(1 + I) BesselJ[1/4, x^2/2]) C[1])/(2 2^(1/4)) +
(Sqrt[π] Sqrt[x] (Sqrt[2] BesselJ[-(1/4), x^2/2] +
(1 - I) BesselJ[1/4, x^2/2]) C[2])/(2 2^(1/4))
`

Of note is that the solution is expressed as a linear combination of Bessel functions of the first kind of both positive and negative orders; this is fine and still consistent with the Maple solution, because the Bessel function of the second kind can be expressed as a linear combination of Bessel functions of the first kind for noninteger orders.