48.4.20 problem Problem 3.33

Internal problem ID [7562]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.6 Summary and Problems. Page 218
Problem number : Problem 3.33
Date solved : Wednesday, March 05, 2025 at 04:45:52 AM
CAS classification : [[_homogeneous, `class D`], _rational, _Riccati]

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

Maple. Time used: 0.006 (sec). Leaf size: 10
ode:=-y(x)+x*diff(y(x),x) = x^2+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (x +c_{1} \right ) x \]
Mathematica. Time used: 0.241 (sec). Leaf size: 12
ode=x*D[y[x],x]-y[x]==(x^2+y[x]^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \tan (x+c_1) \]
Sympy. Time used: 0.374 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + x*Derivative(y(x), x) - y(x)**2 - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (i C_{1} + i e^{2 i x}\right )}{C_{1} - e^{2 i x}} \]