6.5.22 problem 19

Internal problem ID [1646]
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 : 19
Date solved : Tuesday, September 30, 2025 at 04:41:16 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

\begin{align*} x^{2} y^{\prime }&=x y+x^{2}+y^{2} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 11
ode:=x^2*diff(y(x),x) = x*y(x)+x^2+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (\ln \left (x \right )+c_1 \right ) x \]
Mathematica. Time used: 0.123 (sec). Leaf size: 13
ode=x^2*D[y[x],x]==x*y[x]+x^2+y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x \tan (\log (x)+c_1) \end{align*}
Sympy. Time used: 0.168 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - x**2 - x*y(x) - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (i C_{1} + i e^{2 i \log {\left (x \right )}}\right )}{C_{1} - e^{2 i \log {\left (x \right )}}} \]