64.11.41 problem 41

Internal problem ID [13420]
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 : Monday, March 31, 2025 at 07:53:47 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.738 (sec). Leaf size: 96
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]
 
\[ y(x)\to e^{2 x} \left (\int _1^x\frac {1}{2} e^{-4 K[1]} \left (-e^{2 K[1]} K[1] \left (K[1]^2+1\right )-1\right )dK[1]+e^{2 x} \int _1^x\frac {1}{2} e^{-6 K[2]} \left (e^{2 K[2]} \left (K[2]^3+K[2]\right )+1\right )dK[2]+c_2 e^{2 x}+c_1\right ) \]
Sympy. Time used: 0.303 (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} \]