15.6.3 problem 3

Internal problem ID [2960]
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 : 3
Date solved : Sunday, March 30, 2025 at 01:02:07 AM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 16
ode:=diff(y(x),x)+2*x*y(x) = 2*x*exp(-x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (x^{2}+c_1 \right ) {\mathrm e}^{-x^{2}} \]
Mathematica. Time used: 0.066 (sec). Leaf size: 19
ode=D[y[x],x]+2*x*y[x]==2*x*Exp[-x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x^2} \left (x^2+c_1\right ) \]
Sympy. Time used: 0.237 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) - 2*x*exp(-x**2) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x^{2}\right ) e^{- x^{2}} \]