29.19.28 problem 541

Internal problem ID [5137]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 19
Problem number : 541
Date solved : Tuesday, March 04, 2025 at 08:11:12 PM
CAS classification : [[_homogeneous, `class G`], _rational, _Bernoulli]

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

Maple. Time used: 0.014 (sec). Leaf size: 29
ode:=2*x*y(x)*diff(y(x),x) = a*x+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= \sqrt {\left (a \ln \left (x \right )+c_{1} \right ) x} \\ y \left (x \right ) &= -\sqrt {\left (a \ln \left (x \right )+c_{1} \right ) x} \\ \end{align*}
Mathematica. Time used: 0.232 (sec). Leaf size: 44
ode=2 x y[x] D[y[x],x]==a x +y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {x} \sqrt {a \log (x)+c_1} \\ y(x)\to \sqrt {x} \sqrt {a \log (x)+c_1} \\ \end{align*}
Sympy. Time used: 0.465 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a*x + 2*x*y(x)*Derivative(y(x), x) - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {x \left (C_{1} + a \log {\left (x \right )}\right )}, \ y{\left (x \right )} = \sqrt {x \left (C_{1} + a \log {\left (x \right )}\right )}\right ] \]