7.7.32 problem 32

Internal problem ID [210]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Review problems at page 98
Problem number : 32
Date solved : Saturday, March 29, 2025 at 04:46:11 PM
CAS classification : [_separable]

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

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