81.2.1 problem 3-1

Internal problem ID [21490]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 3. Exact differential equations. Page 42.
Problem number : 3-1
Date solved : Thursday, October 02, 2025 at 07:41:53 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }-y x&=x^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 34
ode:=diff(y(x),x)-x*y(x) = x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right )+2 c_1 \right ) {\mathrm e}^{\frac {x^{2}}{2}}}{2}-x \]
Mathematica. Time used: 0.049 (sec). Leaf size: 48
ode=D[y[x],x] -x*y[x]==x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sqrt {\frac {\pi }{2}} e^{\frac {x^2}{2}} \text {erf}\left (\frac {x}{\sqrt {2}}\right )+c_1 e^{\frac {x^2}{2}}-x \end{align*}
Sympy. Time used: 0.317 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 - x*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{\frac {x^{2}}{2}} - x + \frac {\sqrt {2} \sqrt {\pi } e^{\frac {x^{2}}{2}} \operatorname {erf}{\left (\frac {\sqrt {2} x}{2} \right )}}{2} \]