74.3.1 problem 1 (a)

Internal problem ID [15782]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.1, page 32
Problem number : 1 (a)
Date solved : Thursday, March 13, 2025 at 06:19:48 AM
CAS classification : [_Riccati]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \end{align*}

Maple. Time used: 1.010 (sec). Leaf size: 59
ode:=diff(y(t),t)+t^2 = y(t)^2; 
ic:=y(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = -\left (\left \{\begin {array}{cc} 0 & t =0 \\ \frac {\left (\operatorname {BesselI}\left (-\frac {3}{4}, \frac {t^{2}}{2}\right ) \pi \sqrt {2}-2 \operatorname {BesselK}\left (\frac {3}{4}, \frac {t^{2}}{2}\right )\right ) t}{\pi \sqrt {2}\, \operatorname {BesselI}\left (\frac {1}{4}, \frac {t^{2}}{2}\right )+2 \operatorname {BesselK}\left (\frac {1}{4}, \frac {t^{2}}{2}\right )} & \operatorname {otherwise} \end {array}\right .\right ) \]
Mathematica. Time used: 0.613 (sec). Leaf size: 81
ode=D[y[t],t]+t^2==y[t]^2; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to -\frac {i t^2 \operatorname {BesselJ}\left (-\frac {5}{4},\frac {i t^2}{2}\right )-i t^2 \operatorname {BesselJ}\left (\frac {3}{4},\frac {i t^2}{2}\right )+\operatorname {BesselJ}\left (-\frac {1}{4},\frac {i t^2}{2}\right )}{2 t \operatorname {BesselJ}\left (-\frac {1}{4},\frac {i t^2}{2}\right )} \]
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(t**2 - y(t)**2 + Derivative(y(t), t),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
TypeError : bad operand type for unary -: list