80.2.16 problem 23

Internal problem ID [21159]
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 : 23
Date solved : Thursday, October 02, 2025 at 07:14:56 PM
CAS classification : [_quadrature]

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

With initial conditions

\begin{align*} x \left (0\right )&=a \\ \end{align*}
Maple. Time used: 0.036 (sec). Leaf size: 25
ode:=diff(x(t),t) = x(t)^3-x(t); 
ic:=[x(0) = a]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = \frac {a}{\sqrt {-a^{2} {\mathrm e}^{2 t}+a^{2}+{\mathrm e}^{2 t}}} \]
Mathematica. Time used: 0.614 (sec). Leaf size: 45
ode=D[x[t],t]==x[t]^3-x[t]; 
ic={x[0]==a}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -\frac {1}{\sqrt {\left (\frac {1}{a^2}-1\right ) e^{2 t}+1}}\\ x(t)&\to \frac {1}{\sqrt {\left (\frac {1}{a^2}-1\right ) e^{2 t}+1}} \end{align*}
Sympy. Time used: 0.628 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
a = symbols("a") 
x = Function("x") 
ode = Eq(-x(t)**3 - x(t) + Derivative(x(t), t),0) 
ics = {x(0): a} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \sqrt {\frac {e^{2 t}}{- e^{2 t} + 1 + \frac {1}{a^{2}}}} \]