64.6.12 problem 12

Internal problem ID [13283]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, Miscellaneous Review. Exercises page 60
Problem number : 12
Date solved : Wednesday, March 05, 2025 at 09:33:32 PM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 27
ode:=x^2*diff(y(x),x)+x*y(x) = x*y(x)^3; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {1}{\sqrt {c_{1} x^{2}+1}} \\ y &= -\frac {1}{\sqrt {c_{1} x^{2}+1}} \\ \end{align*}
Mathematica. Time used: 0.372 (sec). Leaf size: 52
ode=x^2*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 \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{(K[1]-1) K[1] (K[1]+1)}dK[1]\&\right ][\log (x)+c_1] \\ y(x)\to -1 \\ y(x)\to 0 \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.928 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - x*y(x)**3 + x*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {- \frac {1}{C_{1} x^{2} - 1}}, \ y{\left (x \right )} = \sqrt {- \frac {1}{C_{1} x^{2} - 1}}\right ] \]