67.15.49 problem 22.11 (h)

Internal problem ID [16767]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 22. Method of undetermined coefficients. Additional exercises page 412
Problem number : 22.11 (h)
Date solved : Thursday, October 02, 2025 at 01:38:39 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 6 y-5 y^{\prime }+y^{\prime \prime }&=x^{2} \cos \left (2 x \right ) \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 49
ode:=diff(diff(y(x),x),x)-5*diff(y(x),x)+6*y(x) = x^2*cos(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{3 x} c_2 +{\mathrm e}^{2 x} c_1 +\frac {\left (676 x^{2}-2080 x -1909\right ) \cos \left (2 x \right )}{35152}+\frac {\left (-3380 x^{2}-3796 x -725\right ) \sin \left (2 x \right )}{35152} \]
Mathematica. Time used: 0.039 (sec). Leaf size: 58
ode=D[y[x],{x,2}]-5*D[y[x],x]+6*y[x]==x^2*Cos[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\left (676 x^2-2080 x-1909\right ) \cos (2 x)-\left (3380 x^2+3796 x+725\right ) \sin (2 x)}{35152}+c_1 e^{2 x}+c_2 e^{3 x} \end{align*}
Sympy. Time used: 0.231 (sec). Leaf size: 75
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*cos(2*x) + 6*y(x) - 5*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^{3 x} - \frac {5 x^{2} \sin {\left (2 x \right )}}{52} + \frac {x^{2} \cos {\left (2 x \right )}}{52} - \frac {73 x \sin {\left (2 x \right )}}{676} - \frac {10 x \cos {\left (2 x \right )}}{169} - \frac {725 \sin {\left (2 x \right )}}{35152} - \frac {1909 \cos {\left (2 x \right )}}{35152} \]