48.1.12 problem Example 3.12

Internal problem ID [7513]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.2 FIRST ORDER ODE. Page 114
Problem number : Example 3.12
Date solved : Sunday, March 30, 2025 at 12:11:46 PM
CAS classification : [_rational, _Riccati]

\begin{align*} y^{\prime }&=-\frac {y}{t}-1-y^{2} \end{align*}

Maple. Time used: 0.089 (sec). Leaf size: 32
ode:=diff(y(t),t) = -1/t*y(t)-1-y(t)^2; 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {-i \operatorname {BesselK}\left (1, i t \right ) c_1 -\operatorname {BesselJ}\left (1, t\right )}{\operatorname {BesselK}\left (0, i t \right ) c_1 +\operatorname {BesselJ}\left (0, t\right )} \]
Mathematica. Time used: 0.176 (sec). Leaf size: 43
ode=D[y[t],t]==-y[t]/t-1-y[t]^2; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to -\frac {\operatorname {BesselY}(1,t)+c_1 \operatorname {BesselJ}(1,t)}{\operatorname {BesselY}(0,t)+c_1 \operatorname {BesselJ}(0,t)} \\ y(t)\to -\frac {\operatorname {BesselJ}(1,t)}{\operatorname {BesselJ}(0,t)} \\ \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(y(t)**2 + Derivative(y(t), t) + 1 + y(t)/t,0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
TypeError : bad operand type for unary -: list