6.5.19 problem 16

Internal problem ID [1643]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Transformation of Nonlinear Equations into Separable Equations. Section 2.4 Page 68
Problem number : 16
Date solved : Tuesday, September 30, 2025 at 04:41:06 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

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