29.23.21 problem 652

Internal problem ID [5243]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 23
Problem number : 652
Date solved : Sunday, March 30, 2025 at 07:21:04 AM
CAS classification : [[_homogeneous, `class A`], _rational, _dAlembert]

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

Maple. Time used: 0.019 (sec). Leaf size: 21
ode:=x*(x^2+a*x*y(x)+2*y(x)^2)*diff(y(x),x) = (a*x+2*y(x))*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{\operatorname {RootOf}\left ({\mathrm e}^{2 \textit {\_Z}}+{\mathrm e}^{\textit {\_Z}} a +c_1 +\textit {\_Z} +\ln \left (x \right )\right )} x \]
Mathematica. Time used: 0.171 (sec). Leaf size: 34
ode=x(x^2+a x y[x]+2 y[x]^2)D[y[x],x]==(a x+2 y[x])y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {a y(x)}{x}+\frac {y(x)^2}{x^2}+\log \left (\frac {y(x)}{x}\right )=-\log (x)+c_1,y(x)\right ] \]
Sympy. Time used: 2.255 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(x*(a*x*y(x) + x**2 + 2*y(x)**2)*Derivative(y(x), x) - (a*x + 2*y(x))*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (y{\left (x \right )} \right )} = C_{1} + \frac {\left (- \frac {a x}{y{\left (x \right )}} - 1\right ) y^{2}{\left (x \right )}}{x^{2}} \]