58.11.3 problem 3

Internal problem ID [14734]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 3
Date solved : Thursday, October 02, 2025 at 09:50:37 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 5 y+2 y^{\prime }+y^{\prime \prime }&=6 \sin \left (2 x \right )+7 \cos \left (2 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 35
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+5*y(x) = 6*sin(2*x)+7*cos(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 \cos \left (2 x \right )+c_2 \sin \left (2 x \right )\right ) {\mathrm e}^{-x}-\cos \left (2 x \right )+2 \sin \left (2 x \right ) \]
Mathematica. Time used: 0.013 (sec). Leaf size: 38
ode=D[y[x],{x,2}]+2*D[y[x],x]+5*y[x]==6*Sin[2*x]+7*Cos[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} \left (\left (-e^x+c_2\right ) \cos (2 x)+\left (2 e^x+c_1\right ) \sin (2 x)\right ) \end{align*}
Sympy. Time used: 0.158 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) - 6*sin(2*x) - 7*cos(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 )} = \left (C_{1} \sin {\left (2 x \right )} + C_{2} \cos {\left (2 x \right )}\right ) e^{- x} + 2 \sin {\left (2 x \right )} - \cos {\left (2 x \right )} \]