7.7.6 problem 6

Internal problem ID [184]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Review problems at page 98
Problem number : 6
Date solved : Tuesday, March 04, 2025 at 10:57:08 AM
CAS classification : [_separable]

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

Maple. Time used: 0.004 (sec). Leaf size: 18
ode:=2*x*y(x)^2+x^2*diff(y(x),x) = y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x}{2 \ln \left (x \right ) x +c_1 x +1} \]
Mathematica. Time used: 0.152 (sec). Leaf size: 26
ode=2*x*y[x]^2+x^2*D[y[x],x]==y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x}{2 x \log (x)+c_1 (-x)+1} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.224 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) + 2*x*y(x)**2 - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{C_{1} x + 2 x \log {\left (x \right )} + 1} \]