78.16.27 problem 25 (c)

Internal problem ID [18335]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 23. Operator Methods for Finding Particular Solutions. Problems at page 169
Problem number : 25 (c)
Date solved : Monday, March 31, 2025 at 05:25:49 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+4 y&={\mathrm e}^{2 x} \sin \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 18
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+4*y(x) = exp(2*x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} \left (c_2 +c_1 x -\sin \left (x \right )\right ) \]
Mathematica. Time used: 0.028 (sec). Leaf size: 22
ode=D[y[x],{x,2}]-4*D[y[x],x]+4*y[x]==Exp[2*x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{2 x} (-\sin (x)+c_2 x+c_1) \]
Sympy. Time used: 0.237 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - exp(2*x)*sin(x) - 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} x - \sin {\left (x \right )}\right ) e^{2 x} \]