How to convert solution from ParabolicCylinderD to Bessel functions?
$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. If you want to see the solution in that format, you can do the following:
% /. BesselJ[n_?Internal`SyntacticNegativeQ, z_] :>
Cos[n π] BesselJ[-n, z] + Sin[n π] BesselY[-n, z] // Simplify
-1/2 (Sqrt[π] Sqrt[x] (BesselY[1/4, x^2/2] (C[1] + C[2]) +
I BesselJ[1/4, x^2/2] (C[1] + (1 + 2 I) C[2])))/2^(1/4)