1.11.26 problem 26

Internal problem ID [347]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.5 (Nonhomogeneous equations and undetermined coefficients). Problems at page 161
Problem number : 26
Date solved : Tuesday, September 30, 2025 at 03:57:37 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-6 y^{\prime }+13 y&=x \,{\mathrm e}^{3 x} \sin \left (3 x \right ) \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 37
ode:=diff(diff(y(x),x),x)-6*diff(y(x),x)+13*y(x) = x*exp(3*x)*sin(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (\sin \left (3 x \right ) x -5 c_1 \cos \left (2 x \right )-5 c_2 \sin \left (2 x \right )+\frac {6 \cos \left (3 x \right )}{5}\right ) {\mathrm e}^{3 x}}{5} \]
Mathematica. Time used: 0.015 (sec). Leaf size: 44
ode=D[y[x],{x,2}]-6*D[y[x],{x,1}]+13*y[x]==x*Exp[3*x]*Sin[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{25} e^{3 x} (-5 x \sin (3 x)-6 \cos (3 x)+25 c_2 \cos (2 x)+25 c_1 \sin (2 x)) \end{align*}
Sympy. Time used: 0.244 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(3*x)*sin(3*x) + 13*y(x) - 6*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 )} - \frac {x \sin {\left (3 x \right )}}{5} - \frac {6 \cos {\left (3 x \right )}}{25}\right ) e^{3 x} \]