70.5.21 problem 21

Internal problem ID [18728]
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 : 21
Date solved : Thursday, October 02, 2025 at 03:29:08 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=a y+b y^{3} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 70
ode:=diff(y(t),t) = a*y(t)+b*y(t)^3; 
dsolve(ode,y(t), singsol=all);
 
\begin{align*} y &= \frac {\sqrt {\left (c_1 a \,{\mathrm e}^{-2 a t}-b \right ) a}}{c_1 a \,{\mathrm e}^{-2 a t}-b} \\ y &= -\frac {\sqrt {\left (c_1 a \,{\mathrm e}^{-2 a t}-b \right ) a}}{c_1 a \,{\mathrm e}^{-2 a t}-b} \\ \end{align*}
Mathematica. Time used: 0.131 (sec). Leaf size: 75
ode=D[y[t],t]==a*y[t]+b*y[t]^3; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{K[1] \left (b K[1]^2+a\right )}dK[1]\&\right ][t+c_1]\\ y(t)&\to 0\\ y(t)&\to -\frac {i \sqrt {a}}{\sqrt {b}}\\ y(t)&\to \frac {i \sqrt {a}}{\sqrt {b}} \end{align*}
Sympy. Time used: 4.170 (sec). Leaf size: 58
from sympy import * 
t = symbols("t") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*y(t) - b*y(t)**3 + Derivative(y(t), t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ \left [ y{\left (t \right )} = \sqrt {\frac {a e^{2 a \left (C_{1} + t\right )}}{b \left (1 - e^{2 a \left (C_{1} + t\right )}\right )}}, \ y{\left (t \right )} = - \sqrt {- \frac {a e^{2 a \left (C_{1} + t\right )}}{b \left (e^{2 a \left (C_{1} + t\right )} - 1\right )}}\right ] \]