48.3.14 problem Example 3.43

Internal problem ID [7538]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.5 HIGHER ORDER ODE. Page 181
Problem number : Example 3.43
Date solved : Wednesday, March 05, 2025 at 04:44:25 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+3 y^{\prime }+2 y&=\cos \left (2 x \right ) \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)+3*diff(y(x),x)+2*y(x) = cos(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -c_{1} {\mathrm e}^{-2 x}+c_{2} {\mathrm e}^{-x}+\frac {3 \sin \left (2 x \right )}{20}-\frac {\cos \left (2 x \right )}{20} \]
Mathematica. Time used: 0.125 (sec). Leaf size: 37
ode=D[y[x],{x,2}]+3*D[y[x],x]+2*y[x]==Cos[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {3}{20} \sin (2 x)-\frac {1}{20} \cos (2 x)+e^{-2 x} \left (c_2 e^x+c_1\right ) \]
Sympy. Time used: 0.226 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - cos(2*x) + 3*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^{- 2 x} + C_{2} e^{- x} + \frac {3 \sin {\left (2 x \right )}}{20} - \frac {\cos {\left (2 x \right )}}{20} \]