8.11.15 problem 26

Internal problem ID [883]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 5.5, Nonhomogeneous equations and undetermined coefficients Page 351
Problem number : 26
Date solved : Tuesday, March 04, 2025 at 11:57:35 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-6 y^{\prime }+13 y&=x \,{\mathrm e}^{3 x} \sin \left (2 x \right ) \end{align*}

Maple. Time used: 0.007 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)-6*diff(y(x),x)+13*y(x) = x*exp(3*x)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (\left (x^{2}-8 c_1 \right ) \cos \left (2 x \right )-\frac {\sin \left (2 x \right ) \left (x +16 c_2 \right )}{2}\right ) {\mathrm e}^{3 x}}{8} \]
Mathematica. Time used: 0.101 (sec). Leaf size: 43
ode=D[y[x],{x,2}]-6*D[y[x],x]+13*y[x]==x*Exp[3*x]*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{64} e^{3 x} \left (\left (-8 x^2+1+64 c_2\right ) \cos (2 x)+4 (x+16 c_1) \sin (2 x)\right ) \]
Sympy. Time used: 0.471 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(3*x)*sin(2*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 (\left (C_{1} - \frac {x^{2}}{8}\right ) \cos {\left (2 x \right )} + \left (C_{2} + \frac {x}{16}\right ) \sin {\left (2 x \right )}\right ) e^{3 x} \]