15.12.19 problem 19

Internal problem ID [3163]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 20, page 90
Problem number : 19
Date solved : Sunday, March 30, 2025 at 01:20:04 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 39
ode:=diff(diff(y(x),x),x)-2*y(x) = exp(-x)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\sqrt {2}\, x} c_1 +{\mathrm e}^{\sqrt {2}\, x} c_2 +\frac {4 \,{\mathrm e}^{-x} \left (\cos \left (2 x \right )-\frac {5 \sin \left (2 x \right )}{4}\right )}{41} \]
Mathematica. Time used: 0.261 (sec). Leaf size: 57
ode=D[y[x],{x,2}]-2*y[x]==Exp[-x]*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {5}{41} e^{-x} \sin (2 x)+\frac {4}{41} e^{-x} \cos (2 x)+c_1 e^{\sqrt {2} x}+c_2 e^{-\sqrt {2} x} \]
Sympy. Time used: 0.156 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) + Derivative(y(x), (x, 2)) - exp(-x)*sin(2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \sqrt {2} x} + C_{2} e^{\sqrt {2} x} - \frac {5 e^{- x} \sin {\left (2 x \right )}}{41} + \frac {4 e^{- x} \cos {\left (2 x \right )}}{41} \]