8.6.32 problem 32 (b)

Internal problem ID [802]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Chapter 1 review problems. Page 78
Problem number : 32 (b)
Date solved : Tuesday, March 04, 2025 at 11:49:53 AM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 29
ode:=diff(y(x),x) = -x*y(x)+x*y(x)^3; 
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.871 (sec). Leaf size: 58
ode=D[y[x],x] == -x*y[x]+x*y[x]^3; 
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.296 (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 ] \]