15.6.12 problem 12

Internal problem ID [2969]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 12
Date solved : Sunday, March 30, 2025 at 01:02:33 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 16
ode:=x^2*diff(y(x),x)+y(x)-2*x*y(x)-2*x^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{2} \left ({\mathrm e}^{\frac {1}{x}} c_1 +2\right ) \]
Mathematica. Time used: 0.043 (sec). Leaf size: 19
ode=x^2*D[y[x],x]+(y[x]-2*x*y[x]-2*x^2)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x^2 \left (2+c_1 e^{\frac {1}{x}}\right ) \]
Sympy. Time used: 0.288 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - 2*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}} + 2\right ) \]