80.2.21 problem 28

Internal problem ID [21164]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 2. Theory of first order differential equations. Excercise 2.6 at page 37
Problem number : 28
Date solved : Thursday, October 02, 2025 at 07:15:08 PM
CAS classification : [_Riccati]

\begin{align*} x^{\prime }&=x^{2}-t^{2} \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.272 (sec). Leaf size: 59
ode:=diff(x(t),t) = x(t)^2-t^2; 
ic:=[x(0) = 0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = -\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.589 (sec). Leaf size: 81
ode=D[x[t],t]==x[t]^2-t^2; 
ic={x[0]==0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(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 )} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(t**2 - x(t)**2 + Derivative(x(t), t),0) 
ics = {x(0): 0} 
dsolve(ode,func=x(t),ics=ics)
 
TypeError : bad operand type for unary -: list