72.2.15 problem 15 b(5)

Internal problem ID [14579]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 1. First-Order Differential Equations. Exercises section 1.3 page 47
Problem number : 15 b(5)
Date solved : Monday, March 31, 2025 at 12:35:01 PM
CAS classification : [_quadrature]

\begin{align*} S^{\prime }&=S^{3}-2 S^{2}+S \end{align*}

With initial conditions

\begin{align*} S \left (0\right )&=-{\frac {1}{2}} \end{align*}

Maple. Time used: 0.413 (sec). Leaf size: 39
ode:=diff(S(t),t) = S(t)^3-2*S(t)^2+S(t); 
ic:=S(0) = -1/2; 
dsolve([ode,ic],S(t), singsol=all);
 
\[ S = {\mathrm e}^{\operatorname {RootOf}\left (-3 \,{\mathrm e}^{\textit {\_Z}} \ln \left (3\right )-3 \ln \left ({\mathrm e}^{\textit {\_Z}}+1\right ) {\mathrm e}^{\textit {\_Z}}+3 \textit {\_Z} \,{\mathrm e}^{\textit {\_Z}}+3 t \,{\mathrm e}^{\textit {\_Z}}+2 \,{\mathrm e}^{\textit {\_Z}}+3\right )}+1 \]
Mathematica
ode=D[S[t],t]==S[t]^3-2*S[t]^2+S[t]; 
ic={S[0]==-1/2}; 
DSolve[{ode,ic},S[t],t,IncludeSingularSolutions->True]
 

{}

Sympy. Time used: 0.314 (sec). Leaf size: 26
from sympy import * 
t = symbols("t") 
s = Function("s") 
ode = Eq(-s(t)**3 + 2*s(t)**2 - s(t) + Derivative(s(t), t),0) 
ics = {s(0): -1/2} 
dsolve(ode,func=s(t),ics=ics)
 
\[ t + \log {\left (s{\left (t \right )} - 1 \right )} - \log {\left (s{\left (t \right )} \right )} + \frac {1}{s{\left (t \right )} - 1} = - \frac {2}{3} + \log {\left (3 \right )} \]