84.23.3 problem 14.3

Internal problem ID [22247]
Book : Schaums outline series. Differential Equations By Richard Bronson. 1973. McGraw-Hill Inc. ISBN 0-07-008009-7
Section : Chapter 14. The method of undetermined coefficients. Solved problems. Page 71
Problem number : 14.3
Date solved : Thursday, October 02, 2025 at 08:36:34 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y^{\prime }-2 y&=\sin \left (2 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)-diff(y(x),x)-2*y(x) = sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} c_2 +{\mathrm e}^{-x} c_1 +\frac {\cos \left (2 x \right )}{20}-\frac {3 \sin \left (2 x \right )}{20} \]
Mathematica. Time used: 0.079 (sec). Leaf size: 37
ode=D[y[x],{x,2}]-D[y[x],{x,1}]-2*y[x]==Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 e^{-x}+c_2 e^{2 x}+\frac {1}{20} (\cos (2 x)-3 \sin (2 x)) \end{align*}
Sympy. Time used: 0.142 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) - sin(2*x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{x \left (1 - \sqrt {3}\right )} + C_{2} e^{x \left (1 + \sqrt {3}\right )} - \frac {3 \sin {\left (2 x \right )}}{26} + \frac {\cos {\left (2 x \right )}}{13} \]