20.4.1 problem Problem 9

Internal problem ID [3636]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 9
Date solved : Sunday, March 30, 2025 at 01:55:13 AM
CAS classification : [[_homogeneous, `class A`], _rational, _Riccati]

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

Maple. Time used: 0.005 (sec). Leaf size: 11
ode:=diff(y(x),x) = (y(x)^2+x*y(x)+x^2)/x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (\ln \left (x \right )+c_1 \right ) x \]
Mathematica. Time used: 0.237 (sec). Leaf size: 13
ode=D[y[x],x]==(y[x]^2+x*y[x]+x^2)/x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \tan (\log (x)+c_1) \]
Sympy. Time used: 0.292 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), 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 \left (i C_{1} + i e^{2 i \log {\left (x \right )}}\right )}{C_{1} - e^{2 i \log {\left (x \right )}}} \]