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

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

I am assuming both solutions are mathematically equivalent.

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

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

Mathematica graphics

While in Maple

Mathematica graphics

This is what I tried in Mathematica


Mathematica graphics

 MeijerGReduce[FunctionExpand[sol], x]

Mathematica graphics

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

Mathematica 12.0 on Windows 10.


2 Answers 2


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


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:

         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)
  • 1
    $\begingroup$ It is a very interesting solution. It would be very helpful if you kindly comment on the idea behind. $\endgroup$ Commented Jan 12, 2021 at 12:27
  • $\begingroup$ I'm basically exploiting the fact that the appropriate cases of MeijerG[] automagically expand to BesselJ[]. $\endgroup$ Commented Jan 12, 2021 at 12:37

Your Answer

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

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