58.11.14 problem 14

Internal problem ID [14745]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 14
Date solved : Thursday, October 02, 2025 at 09:50:43 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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