59.1.282 problem 285

Internal problem ID [9454]
Book : Collection of Kovacic problems
Section : section 1
Problem number : 285
Date solved : Sunday, March 30, 2025 at 02:35:18 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+q y^{\prime }&=\frac {2 y}{x^{2}} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 28
ode:=diff(diff(y(x),x),x)+q*diff(y(x),x) = 2/x^2*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1 \left (q x -2\right )+c_2 \,{\mathrm e}^{-q x} \left (q x +2\right )}{x} \]
Mathematica. Time used: 0.081 (sec). Leaf size: 83
ode=D[y[x],{x,2}]+q*D[y[x],x]==2*y[x]/x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {2 q x^{3/2} e^{\frac {1}{2}-\frac {q x}{2}} \left ((c_1 q x+2 i c_2) \cosh \left (\frac {q x}{2}\right )-(i c_2 q x+2 c_1) \sinh \left (\frac {q x}{2}\right )\right )}{\sqrt {\pi } (-i q x)^{5/2}} \]
Sympy
from sympy import * 
x = symbols("x") 
q = symbols("q") 
y = Function("y") 
ode = Eq(q*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 2*y(x)/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
False