76.5.22 problem 23 (b)

Internal problem ID [17371]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.7 (Substitution Methods). Problems at page 108
Problem number : 23 (b)
Date solved : Monday, March 31, 2025 at 04:09:34 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }+3 t y&=4-4 t^{2}+y^{2} \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 55
ode:=diff(y(t),t)+3*t*y(t) = 4-4*t^2+y(t)^2; 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {4 i \sqrt {\pi }\, \operatorname {erf}\left (\frac {i \sqrt {10}\, t}{2}\right ) \sqrt {10}\, t +40 c_1 t +10 \,{\mathrm e}^{\frac {5 t^{2}}{2}}}{i \sqrt {\pi }\, \sqrt {10}\, \operatorname {erf}\left (\frac {i \sqrt {10}\, t}{2}\right )+10 c_1} \]
Mathematica. Time used: 0.187 (sec). Leaf size: 52
ode=D[y[t],t]+3*t*y[t]==4-4*t^2+y[t]^2; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to 4 t+\frac {e^{\frac {5 t^2}{2}}}{-\sqrt {\frac {\pi }{10}} \text {erfi}\left (\sqrt {\frac {5}{2}} t\right )+c_1} \\ y(t)\to 4 t \\ \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(4*t**2 + 3*t*y(t) - y(t)**2 + Derivative(y(t), t) - 4,0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
TypeError : bad operand type for unary -: list