76.33.25 problem Ex. 25

Internal problem ID [20203]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. Examples on chapter VI, page 80
Problem number : Ex. 25
Date solved : Thursday, October 02, 2025 at 05:34:38 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+3 y&={\mathrm e}^{x} \cos \left (2 x \right )+\cos \left (3 x \right ) \end{align*}
Maple. Time used: 0.008 (sec). Leaf size: 43
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+3*y(x) = exp(x)*cos(2*x)+cos(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{3 x} c_2 +{\mathrm e}^{x} c_1 -\frac {\sin \left (3 x \right )}{15}-\frac {\cos \left (3 x \right )}{30}-\frac {{\mathrm e}^{x} \sin \left (2 x \right )}{8}-\frac {{\mathrm e}^{x} \cos \left (2 x \right )}{8} \]
Mathematica. Time used: 0.127 (sec). Leaf size: 55
ode=D[y[x],{x,2}]-4*D[y[x],x]+3*y[x]==Exp[x]*Cos[2*x]+Cos[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 e^x+c_2 e^{3 x}+\frac {1}{120} \left (-15 e^x \sin (2 x)-8 \sin (3 x)-15 e^x \cos (2 x)-4 \cos (3 x)\right ) \end{align*}
Sympy. Time used: 0.208 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*y(x) - exp(x)*cos(2*x) - cos(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 )} = C_{2} e^{3 x} + \left (C_{1} - \frac {\sin {\left (2 x \right )}}{8} - \frac {\cos {\left (2 x \right )}}{8}\right ) e^{x} - \frac {\sin {\left (3 x \right )}}{15} - \frac {\cos {\left (3 x \right )}}{30} \]