0

I want to solve the following differential equation:

eq=N*D[q[x],{x,2}]-(6x-x^2)*D[q[x],{x,1}]-s*q[x]==-1
DSolve[eq, q[x],x]

But I get no solution. If I change the (6x-x^2) coefficient by 6x or 6/x I get a solution, so I was wondering if Mathematica cannot solve this or if there is no closed form solution at all.

Thanks in advance!

Julia
  • 21
  • 2
  • Maple 2021 can solve.Solution by HeunT function. – Mariusz Iwaniuk May 06 '21 at 13:46
  • There is a solution in V12.2. Note N is a protected symbol, which should not be used as a variable/parameter. (See #4 https://mathematica.stackexchange.com/a/18395) – Michael E2 May 06 '21 at 13:51
  • In fact, Methematica 12.2 returns the input. Maple 2021 answers $$ q! \left(x\right)=\mathrm{HeunT}! \left(-\frac{3^{\frac{2}{3}} s}{n^{\frac{1}{3}}},3,-\frac{9 ,3^{\frac{1}{3}}}{n^{\frac{2}{3}}},-\frac{3^{\frac{2}{3}} \left(x-3\right)}{3 n^{\frac{1}{3}}}\right) \textit{_}\mathit{C2}+{\mathrm e}^{-\frac{x^{2} \left(x-9\right)}{3 n}} \mathrm{HeunT}! \left(-\frac{3^{\frac{2}{3}} s}{n^{\frac{1}{3}}},-3,-\frac{9 ,3^{\frac{1}{3}}}{n^{\frac{2}{3}}},\frac{3^{\frac{2}{3}} \left(x-3\right)}{3 n^{\frac{1}{3}}}\right) \textit{_}\mathit{C1}+\frac{1}{s}$$, but – user64494 May 06 '21 at 13:57
  • the HeunT function is a special function for the notation of the solutions of certain ODEs. – user64494 May 06 '21 at 14:00
  • In fact, V12.2.0.0/MacOS returns a (somewhat obvious) differential root (from a fresh kernel). Seems to me that should happen in earlier versions, at least recent ones. I get the same in V12.0.0.0, too. I cannot test earlier versions. – Michael E2 May 06 '21 at 14:11
  • Thank you! I will try it out on Maple as Mathematica seems to be at an early stage with these functions. Anyway, I found this article about the Heun functions and their implementation on Mathematica: https://blog.wolfram.com/2020/05/06/from-sine-to-heun-5-new-functions-for-mathematics-and-physics-in-the-wolfram-language/ From what I read these functions cannot be expresed in closed form... – Julia May 06 '21 at 15:40

1 Answers1

1
$Version

(* "12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)" *)

Clear["Global`*"]

eqn = {
   n*q''[x] - (6 x - x^2)*q'[x] - s*q[x] == -1,
   q[0] == q0, q'[0] == qp0};

The solution is given as a DifferentialRoot

(sol[q0_, qp0_, n_, s_] = DSolve[eqn, q, x][[1]])

enter image description here

% // InputForm

enter image description here

To numerically evaluate the solution, the initial conditions and all variables must be given values:

(q[1.0] /. sol[0, 1, 2, 1/2])

(* 1.37193 *)

Or using ParametricNDSolve for a numeric solution

soln = ParametricNDSolve[eqn, q, {x, 0, 2},
  {q0, qp0, n, s}]

q[0, 1, 2, 1/2][1.0] /. soln

(* 1.37193 *)

Manipulate[ Plot3D[ Evaluate[q[q0, qp0, 2, s][x] /. soln], {x, 0, 2}, {n, -3, 3}, AxesLabel -> (Style[#, 12, Bold] & /@ {x, n, q})], {{q0, 0, "q[0]"}, -1, 1, 0.05, Appearance -> "Labeled"}, {{qp0, 0.35, "q'[0]"}, -1, 1, 0.05, Appearance -> "Labeled"}, {{s, 0.5}, -5, 5, 0.5, Appearance -> "Labeled"}]

enter image description here

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198