29.8.32 problem 237

Internal problem ID [4837]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 8
Problem number : 237
Date solved : Sunday, March 30, 2025 at 04:03:05 AM
CAS classification : [_rational, _Riccati]

\begin{align*} 2 x y^{\prime }+1&=4 i x y+y^{2} \end{align*}

Maple. Time used: 0.027 (sec). Leaf size: 58
ode:=2*x*diff(y(x),x)+1 = 4*I*x*y(x)+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {i \operatorname {BesselJ}\left (1, x\right )-\operatorname {BesselK}\left (1, i x \right ) c_1 +\operatorname {BesselK}\left (0, i x \right ) c_1 +\operatorname {BesselJ}\left (0, x\right )}{i \operatorname {BesselJ}\left (1, x\right )-\operatorname {BesselK}\left (1, i x \right ) c_1 -\operatorname {BesselK}\left (0, i x \right ) c_1 -\operatorname {BesselJ}\left (0, x\right )} \]
Mathematica. Time used: 0.488 (sec). Leaf size: 161
ode=2 x D[y[x],x]+1==4 I x y[x]+y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {(1-i) c_1 e^{i x} \sqrt {x} ((x-i) \operatorname {BesselJ}(0,x)-\operatorname {BesselJ}(1,x)+x \operatorname {BesselJ}(2,x))-4 i x G_{1,2}^{2,0}\left (-2 i x\left | \begin {array}{c} -1 \\ -\frac {3}{2},-\frac {1}{2} \\ \end {array} \right .\right )}{G_{1,2}^{2,0}\left (-2 i x\left | \begin {array}{c} 1 \\ -\frac {1}{2},\frac {1}{2} \\ \end {array} \right .\right )+(1+i) c_1 e^{i x} \sqrt {x} (\operatorname {BesselJ}(0,x)-i \operatorname {BesselJ}(1,x))} \\ y(x)\to -\frac {i ((x-i) \operatorname {BesselJ}(0,x)-\operatorname {BesselJ}(1,x)+x \operatorname {BesselJ}(2,x))}{\operatorname {BesselJ}(0,x)-i \operatorname {BesselJ}(1,x)} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*complex(0, -4)*y(x) + 2*x*Derivative(y(x), x) - y(x)**2 + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : bad operand type for unary -: list