85.61.7 problem 7

Internal problem ID [22861]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 4. Linear differential equations. A Exercises at page 208
Problem number : 7
Date solved : Thursday, October 02, 2025 at 09:15:53 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+4 y&={\mathrm e}^{2 x} \sin \left (3 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 20
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+4*y(x) = exp(2*x)*sin(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} \left (c_2 +c_1 x -\frac {\sin \left (3 x \right )}{9}\right ) \]
Mathematica. Time used: 0.049 (sec). Leaf size: 28
ode=D[y[x],{x,2}]-4*D[y[x],{x,1}]+4*y[x]==Exp[2*x]*Sin[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{9} e^{2 x} (\sin (3 x)-9 (c_2 x+c_1)) \end{align*}
Sympy. Time used: 0.186 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - exp(2*x)*sin(3*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 - \frac {\sin {\left (3 x \right )}}{9}\right ) e^{2 x} \]