83.37.13 problem 13

Internal problem ID [19387]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter VIII. Linear equations of second order. Excercise VIII (B) at page 128
Problem number : 13
Date solved : Monday, March 31, 2025 at 07:12:12 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }-2 n x y^{\prime }+\left (a^{2} x^{2}+n^{2}+n \right ) y&=0 \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 21
ode:=x^2*diff(diff(y(x),x),x)-2*n*x*diff(y(x),x)+(a^2*x^2+n^2+n)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{n} \left (c_1 \sin \left (a x \right )+c_2 \cos \left (a x \right )\right ) \]
Mathematica. Time used: 0.051 (sec). Leaf size: 42
ode=x^2*D[y[x],{x,2}]-2*n*x*D[y[x],x]+(n^2+n+a^2*x^2)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_1 e^{-i a x} x^n-\frac {i c_2 e^{i a x} x^n}{2 a} \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-2*n*x*Derivative(y(x), x) + x**2*Derivative(y(x), (x, 2)) + (a**2*x**2 + n**2 + n)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : invalid input: 2*n + 1