29.23.4 problem 634

Internal problem ID [5226]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 23
Problem number : 634
Date solved : Tuesday, March 04, 2025 at 08:34:42 PM
CAS classification : [[_homogeneous, `class A`], _rational, _dAlembert]

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

Maple. Time used: 0.166 (sec). Leaf size: 105
ode:=(x^2+x*y(x)+a*y(x)^2)*diff(y(x),x) = a*x^2+x*y(x)+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = x^{\frac {-2 a +2}{2+a}} {\mathrm e}^{\frac {\left (-a +1\right ) \operatorname {RootOf}\left ({\mathrm e}^{\textit {\_Z}}-x^{-\frac {6 a}{2+a}} {\mathrm e}^{-\frac {2 \left (\textit {\_Z} a +3 c_{1} a -\textit {\_Z} \right )}{2+a}}-3 x^{-\frac {3 a}{2+a}} {\mathrm e}^{-\frac {\textit {\_Z} a +3 c_{1} a -\textit {\_Z}}{2+a}}-3\right )-3 c_{1} a}{2+a}}+x \]
Mathematica. Time used: 0.217 (sec). Leaf size: 54
ode=(x^2+x y[x]+a y[x]^2)D[y[x],x]==a x^2+x y[x]+y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {1}{3} (a-1) \log \left (\frac {y(x)^2}{x^2}+\frac {y(x)}{x}+1\right )+\frac {1}{3} (a+2) \log \left (1-\frac {y(x)}{x}\right )=-a \log (x)+c_1,y(x)\right ] \]
Sympy. Time used: 75.643 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a*x**2 - x*y(x) + (a*y(x)**2 + x**2 + x*y(x))*Derivative(y(x), x) - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x \right )} = C_{1} - \log {\left (\sqrt [3]{\left (-1 + \frac {y{\left (x \right )}}{x}\right )^{\frac {a + 2}{a}}} \sqrt [3]{\left (1 + \frac {y{\left (x \right )}}{x} + \frac {y^{2}{\left (x \right )}}{x^{2}}\right )^{\frac {a - 1}{a}}} \right )} \]