58.1.13 problem 6(a)

Internal problem ID [14539]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 1, Differential equations and their solutions. Exercises page 13
Problem number : 6(a)
Date solved : Thursday, October 02, 2025 at 09:38:23 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} 2 y+y^{\prime }&=6 \,{\mathrm e}^{x}+4 x \,{\mathrm e}^{-2 x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=diff(y(x),x)+2*y(x) = 6*exp(x)+4*x*exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (2 x^{2}+2 \,{\mathrm e}^{3 x}+c_1 \right ) {\mathrm e}^{-2 x} \]
Mathematica. Time used: 0.046 (sec). Leaf size: 26
ode=D[y[x],x]+2*y[x]==6*Exp[x]+4*x*Exp[-2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-2 x} \left (2 x^2+2 e^{3 x}+c_1\right ) \end{align*}
Sympy. Time used: 0.111 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x*exp(-2*x) + 2*y(x) - 6*exp(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + 2 x^{2}\right ) e^{- 2 x} + 2 e^{x} \]