58.11.41 problem 41

Internal problem ID [14772]
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 : 41
Date solved : Thursday, October 02, 2025 at 09:51:01 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-6 y^{\prime }+8 y&=x^{3}+x +{\mathrm e}^{-2 x} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 38
ode:=diff(diff(y(x),x),x)-6*diff(y(x),x)+8*y(x) = x^3+x+exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{4 x} c_1}{2}+\frac {{\mathrm e}^{-2 x}}{24}+\frac {69}{256}+\frac {29 x}{64}+\frac {9 x^{2}}{32}+\frac {x^{3}}{8}+{\mathrm e}^{2 x} c_2 \]
Mathematica. Time used: 0.442 (sec). Leaf size: 50
ode=D[y[x],{x,2}]-6*D[y[x],x]+8*y[x]==x^3+x+Exp[-2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{256} \left (32 x^3+72 x^2+116 x+69\right )+\frac {e^{-2 x}}{24}+c_1 e^{2 x}+c_2 e^{4 x} \end{align*}
Sympy. Time used: 0.199 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 - x + 8*y(x) - 6*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{2 x} + C_{2} e^{4 x} + \frac {x^{3}}{8} + \frac {9 x^{2}}{32} + \frac {29 x}{64} + \frac {69}{256} + \frac {e^{- 2 x}}{24} \]