62.11.1 problem Ex 1

Internal problem ID [12764]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 18. Transformation of variables. Page 26
Problem number : Ex 1
Date solved : Wednesday, March 05, 2025 at 08:26:44 PM
CAS classification : [_linear]

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

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