65.5.8 problem 10.4 (i)

Internal problem ID [13668]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 10, Two tricks for nonlinear equations. Exercises page 97
Problem number : 10.4 (i)
Date solved : Wednesday, March 05, 2025 at 10:11:07 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

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

Maple. Time used: 0.008 (sec). Leaf size: 11
ode:=x*y(x)+y(x)^2+x^2-x^2*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (\ln \left (x \right )+c_{1} \right ) x \]
Mathematica. Time used: 0.097 (sec). Leaf size: 29
ode=x*y[x]+y[x]^2+x^2-x^2*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^{\frac {y(x)}{x}}\frac {1}{K[1]^2+1}dK[1]=\log (x)+c_1,y(x)\right ] \]
Sympy. Time used: 0.279 (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 )}}} \]