59.5.8 problem 10.4 (i)

Internal problem ID [15028]
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 : Thursday, October 02, 2025 at 10:01:58 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

\begin{align*} y x +y^{2}+x^{2}-x^{2} y^{\prime }&=0 \end{align*}
Maple. Time used: 0.003 (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.139 (sec). Leaf size: 13
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]
 
\begin{align*} y(x)&\to x \tan (\log (x)+c_1) \end{align*}
Sympy. Time used: 0.172 (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 )}}} \]