82.31.2 problem Ex. 2

Internal problem ID [18819]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. problems at page 79
Problem number : Ex. 2
Date solved : Monday, March 31, 2025 at 06:15:41 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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