7.11.13 problem 13

Internal problem ID [334]
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 : 13
Date solved : Saturday, March 29, 2025 at 04:51:01 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y^{\prime }+5 y&={\mathrm e}^{x} \sin \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+5*y(x) = exp(x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\cos \left (2 x \right ) c_1 +c_2 \sin \left (2 x \right )\right ) {\mathrm e}^{-x}-\frac {4 \left (\cos \left (x \right )-\frac {7 \sin \left (x \right )}{4}\right ) {\mathrm e}^{x}}{65} \]
Mathematica. Time used: 0.216 (sec). Leaf size: 48
ode=D[y[x],{x,2}]+2*D[y[x],x]+5*y[x]==Exp[x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {7}{65} e^x \sin (x)-\frac {4}{65} e^x \cos (x)+c_2 e^{-x} \cos (2 x)+c_1 e^{-x} \sin (2 x) \]
Sympy. Time used: 0.291 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) - exp(x)*sin(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} + \frac {\left (7 \sin {\left (x \right )} - 4 \cos {\left (x \right )}\right ) e^{x}}{65} \]