23.3.19 problem 19

Internal problem ID [5733]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 19
Date solved : Tuesday, September 30, 2025 at 02:02:14 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+y^{\prime \prime }&={\mathrm e}^{x} \sin \left (2 x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 35
ode:=y(x)+diff(diff(y(x),x),x) = exp(x)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {2 \cos \left (x \right )^{2} {\mathrm e}^{x}}{5}+\frac {\left (-{\mathrm e}^{x} \sin \left (x \right )+5 c_1 \right ) \cos \left (x \right )}{5}+\sin \left (x \right ) c_2 +\frac {{\mathrm e}^{x}}{5} \]
Mathematica. Time used: 0.117 (sec). Leaf size: 37
ode=y[x] + D[y[x],{x,2}] == E^x*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{5} e^x \cos (2 x)+c_2 \sin (x)+\cos (x) \left (-\frac {1}{5} e^x \sin (x)+c_1\right ) \end{align*}
Sympy. Time used: 0.060 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(x)*sin(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} - \frac {e^{x} \sin {\left (2 x \right )}}{10} - \frac {e^{x} \cos {\left (2 x \right )}}{5} \]