78.6.10 problem 2 (j)

Internal problem ID [18107]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Section 10 (Linear equations). Problems at page 82
Problem number : 2 (j)
Date solved : Monday, March 31, 2025 at 05:10:33 PM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 16
ode:=y(x)-2*x*y(x)-x^2+x^2*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{2} \left ({\mathrm e}^{\frac {1}{x}} c_1 +1\right ) \]
Mathematica. Time used: 0.037 (sec). Leaf size: 19
ode=(y[x]-2*x*y[x]-x^2)+x^2*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x^2 \left (1+c_1 e^{\frac {1}{x}}\right ) \]
Sympy. Time used: 0.289 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - x**2 - 2*x*y(x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x^{2} \left (C_{1} e^{\frac {1}{x}} + 1\right ) \]