7.5.21 problem 21

Internal problem ID [125]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.6 (substitution and exact equations). Problems at page 72
Problem number : 21
Date solved : Saturday, March 29, 2025 at 04:33:37 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.003 (sec). Leaf size: 29
ode:=diff(y(x),x) = y(x)+y(x)^3; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {1}{\sqrt {{\mathrm e}^{-2 x} c_1 -1}} \\ y &= -\frac {1}{\sqrt {{\mathrm e}^{-2 x} c_1 -1}} \\ \end{align*}
Mathematica. Time used: 60.065 (sec). Leaf size: 57
ode=D[y[x],x]==y[x]+y[x]^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {i e^{x+c_1}}{\sqrt {-1+e^{2 (x+c_1)}}} \\ y(x)\to \frac {i e^{x+c_1}}{\sqrt {-1+e^{2 (x+c_1)}}} \\ \end{align*}
Sympy. Time used: 0.897 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)**3 - y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {\frac {e^{2 x}}{C_{1} - e^{2 x}}}, \ y{\left (x \right )} = \sqrt {\frac {e^{2 x}}{C_{1} - e^{2 x}}}\right ] \]