##### 4.5.40 $$2 x y'(x)+1=y(x)^2+4 i x y(x)$$

ODE
$2 x y'(x)+1=y(x)^2+4 i x y(x)$ ODE Classiﬁcation

[_rational, _Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.330471 (sec), leaf count = 120

$\left \{\left \{y(x)\to \frac {(1-i) c_1 e^{i x} \sqrt {x} ((x-i) J_0(x)-J_1(x)+x J_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} (J_0(x)-i J_1(x))}\right \}\right \}$

Maple
cpu = 0.242 (sec), leaf count = 62

$\left [y \left (x \right ) = \frac {i \BesselJ \left (1, x\right )+\BesselK \left (1, i x \right ) \textit {\_C1} -\BesselK \left (0, i x \right ) \textit {\_C1} +\BesselJ \left (0, x\right )}{i \BesselJ \left (1, x\right )+\BesselK \left (1, i x \right ) \textit {\_C1} +\BesselK \left (0, i x \right ) \textit {\_C1} -\BesselJ \left (0, x\right )}\right ]$ Mathematica raw input

DSolve[1 + 2*x*y'[x] == (4*I)*x*y[x] + y[x]^2,y[x],x]

Mathematica raw output

{{y[x] -> ((1 - I)*E^(I*x)*Sqrt[x]*((-I + x)*BesselJ[0, x] - BesselJ[1, x] + x*B
esselJ[2, x])*C[1] - (4*I)*x*MeijerG[{{}, {-1}}, {{-3/2, -1/2}, {}}, (-2*I)*x])/
((1 + I)*E^(I*x)*Sqrt[x]*(BesselJ[0, x] - I*BesselJ[1, x])*C[1] + MeijerG[{{}, {
1}}, {{-1/2, 1/2}, {}}, (-2*I)*x])}}

Maple raw input

dsolve(2*x*diff(y(x),x)+1 = 4*I*x*y(x)+y(x)^2, y(x))

Maple raw output

[y(x) = (I*BesselJ(1,x)+BesselK(1,I*x)*_C1-BesselK(0,I*x)*_C1+BesselJ(0,x))/(I*B
esselJ(1,x)+BesselK(1,I*x)*_C1+BesselK(0,I*x)*_C1-BesselJ(0,x))]