38.1.7 problem 7

Internal problem ID [6424]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Test excercise 24. page 1067
Problem number : 7
Date solved : Wednesday, March 05, 2025 at 12:39:56 AM
CAS classification : [[_homogeneous, `class A`], _rational, _dAlembert]

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

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