14.5.5 problem 5

Internal problem ID [2542]
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 : 5
Date solved : Tuesday, March 04, 2025 at 02:27:02 PM
CAS classification : [_Bernoulli]

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

With initial conditions

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

Maple. Time used: 0.055 (sec). Leaf size: 19
ode:=diff(y(t),t) = t*y(t)^3-y(t); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \frac {2}{\sqrt {2+4 t +2 \,{\mathrm e}^{2 t}}} \]
Mathematica. Time used: 3.236 (sec). Leaf size: 25
ode=D[y[t],t]==t*y[t]^3-y[t]; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {\sqrt {2}}{\sqrt {2 t+e^{2 t}+1}} \]
Sympy. Time used: 0.790 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t*y(t)**3 + y(t) + Derivative(y(t), t),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \sqrt {2} \sqrt {\frac {1}{2 t + e^{2 t} + 1}} \]