73.15.20 problem 22.7 (e)

Internal problem ID [15380]
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.7 (e)
Date solved : Monday, March 31, 2025 at 01:36:02 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }+y&=\left (-6 x -8\right ) \cos \left (2 x \right )+\left (8 x -11\right ) \sin \left (2 x \right ) \end{align*}

Maple. Time used: 0.007 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+y(x) = (-6*x-8)*cos(2*x)+(8*x-11)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2 \cos \left (2 x \right ) x +\sin \left (2 x \right )+\left (c_1 x +c_2 \right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.022 (sec). Leaf size: 28
ode=D[y[x],{x,2}]-2*D[y[x],x]+y[x]==(-6*x-8)*Cos[2*x]+(8*x-11)*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sin (2 x)+2 x \cos (2 x)+e^x (c_2 x+c_1) \]
Sympy. Time used: 0.350 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(-6*x - 8)*cos(2*x) - (8*x - 11)*sin(2*x) + y(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 2 x \cos {\left (2 x \right )} + \left (C_{1} + C_{2} x\right ) e^{x} + \sin {\left (2 x \right )} \]