78.6.4 problem 2 (d)

Internal problem ID [18172]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Section 10 (Linear equations). Problems at page 82
Problem number : 2 (d)
Date solved : Tuesday, January 28, 2025 at 11:36:07 AM
CAS classification : [[_linear, `class A`]]

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

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.147 (sec). Leaf size: 29

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