80.8.18 problem 24

Internal problem ID [21375]
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 8. Qualitative analysis of 2 by 2 systems and nonlinear second order equations. Excercise 8.5 at page 184
Problem number : 24
Date solved : Thursday, October 02, 2025 at 07:30:01 PM
CAS classification : [[_2nd_order, _missing_x], [_2nd_order, _reducible, _mu_x_y1]]

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

With initial conditions

\begin{align*} x \left (0\right )&=2 \\ x^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.811 (sec). Leaf size: 116
ode:=diff(diff(x(t),t),t) = x(t)-x(t)^3; 
ic:=[x(0) = 2, D(x)(0) = 0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = \operatorname {RootOf}\left (\textit {\_Z} \sqrt {2}\, \sqrt {\frac {1}{\textit {\_Z}^{2}+1}}-2\right ) \sqrt {2}\, \sqrt {\frac {1}{{\operatorname {RootOf}\left (\textit {\_Z} \sqrt {2}\, \sqrt {\frac {1}{\textit {\_Z}^{2}+1}}-2\right )}^{2}+1}}\, \operatorname {JacobiSN}\left (i t \sqrt {\frac {1}{{\operatorname {RootOf}\left (\textit {\_Z} \sqrt {2}\, \sqrt {\frac {1}{\textit {\_Z}^{2}+1}}-2\right )}^{2}+1}}+\operatorname {EllipticK}\left (\operatorname {RootOf}\left (\textit {\_Z} \sqrt {2}\, \sqrt {\frac {1}{\textit {\_Z}^{2}+1}}-2\right )\right ), \operatorname {RootOf}\left (\textit {\_Z} \sqrt {2}\, \sqrt {\frac {1}{\textit {\_Z}^{2}+1}}-2\right )\right ) \]
Mathematica. Time used: 10.118 (sec). Leaf size: 44
ode=D[x[t],{t,2}]==x[t]-x[t]^3; 
ic={x[0]==2,Derivative[1][x][0] ==0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to i \sqrt {2} \text {sn}\left (i \sqrt {2} t-\text {sn}^{-1}\left (i \sqrt {2}|-\frac {1}{2}\right )|-\frac {1}{2}\right ) \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(x(t)**3 - x(t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 2, Subs(Derivative(x(t), t), t, 0): 0} 
dsolve(ode,func=x(t),ics=ics)
 
Timed Out