14.5.2 problem 2

Internal problem ID [2539]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 1. First order differential equations. Section 1.17. What to do in practice. Excercises page 126
Problem number : 2
Date solved : Tuesday, March 04, 2025 at 02:26:55 PM
CAS classification : [_Riccati]

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

With initial conditions

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

Maple. Time used: 0.109 (sec). Leaf size: 45
ode:=diff(y(t),t) = 1-t+y(t)^2; 
ic:=y(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \frac {-\operatorname {AiryAi}\left (1, -1+t \right ) \operatorname {AiryBi}\left (1, -1\right )+\operatorname {AiryBi}\left (1, -1+t \right ) \operatorname {AiryAi}\left (1, -1\right )}{\operatorname {AiryAi}\left (-1+t \right ) \operatorname {AiryBi}\left (1, -1\right )-\operatorname {AiryBi}\left (-1+t \right ) \operatorname {AiryAi}\left (1, -1\right )} \]
Mathematica. Time used: 0.165 (sec). Leaf size: 40
ode=D[y[t],t]==1-t+y[t]^2; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {\operatorname {AiryBiPrime}(-1) \operatorname {AiryAiPrime}(t-1)-\operatorname {AiryAiPrime}(-1) \operatorname {AiryBiPrime}(t-1)}{\operatorname {AiryAiPrime}(-1) \operatorname {AiryBi}(t-1)-\operatorname {AiryBiPrime}(-1) \operatorname {AiryAi}(t-1)} \]
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(t - y(t)**2 + Derivative(y(t), t) - 1,0) 
ics = {y(0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
TypeError : bad operand type for unary -: list