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.0151758 (sec), leaf count = 42

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

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

\[ \left \{ y \left ( x \right ) = \left ( -{\frac {1}{a+2}{{\rm e}^{-{\frac {{x}^{2} \left ( a+2 \right ) }{2}}}}}+{\it \_C1} \right ) {{\rm 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^(-((2 + a)*x^2)/2) + (2 + a)*C[1]))/(2 + a)}}

Maple raw input

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

Maple raw output

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