10.6.18 problem 18

Internal problem ID [1235]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Miscellaneous problems, end of chapter 2. Page 133
Problem number : 18
Date solved : Monday, January 27, 2025 at 04:47:01 AM
CAS classification : [[_linear, `class A`]]

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

Solution by Maple

Time used: 0.001 (sec). Leaf size: 20

dsolve(2*y(x)+diff(y(x),x) = exp(-x^2-2*x),y(x), singsol=all)
 
\[ y = \frac {\left (\sqrt {\pi }\, \operatorname {erf}\left (x \right )+2 c_1 \right ) {\mathrm e}^{-2 x}}{2} \]

Solution by Mathematica

Time used: 0.068 (sec). Leaf size: 27

DSolve[2*y[x]+D[y[x],x] == Exp[-x^2-2*x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {1}{2} e^{-2 x} \left (\sqrt {\pi } \text {erf}(x)+2 c_1\right ) \]