4.1.9 \(y'(x)=x \left (a y(x)+e^{-x^2}\right )\)

ODE
\[ y'(x)=x \left (a y(x)+e^{-x^2}\right ) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.187445 (sec), leaf count = 42

\[\left \{\left \{y(x)\to \frac {e^{\frac {a x^2}{2}} \left (-e^{-\frac {1}{2} (a+2) x^2}+(a+2) c_1\right )}{a+2}\right \}\right \}\]

Maple
cpu = 0.011 (sec), leaf count = 30

\[\left [y \left (x \right ) = \left (-\frac {{\mathrm e}^{-\frac {x^{2} \left (a +2\right )}{2}}}{a +2}+\textit {\_C1} \right ) {\mathrm e}^{\frac {a \,x^{2}}{2}}\right ]\] Mathematica raw input

DSolve[y'[x] == x*(E^(-x^2) + a*y[x]),y[x],x]

Mathematica raw output

{{y[x] -> (E^((a*x^2)/2)*(-E^(-1/2*((2 + a)*x^2)) + (2 + a)*C[1]))/(2 + a)}}

Maple raw input

dsolve(diff(y(x),x) = x*(exp(-x^2)+a*y(x)), y(x))

Maple raw output

[y(x) = (-1/(a+2)*exp(-1/2*x^2*(a+2))+_C1)*exp(1/2*a*x^2)]