40.10.7 problem 16

Internal problem ID [6729]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 15. Linear equations with constant coefficients (Variation of parameters). Supplemetary problems. Page 98
Problem number : 16
Date solved : Sunday, March 30, 2025 at 11:20:50 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)-y(x) = exp(x)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{x} \cos \left (2 x \right )}{8}+{\mathrm e}^{-x} c_1 +{\mathrm e}^{x} \left (c_2 -\frac {\sin \left (2 x \right )}{8}\right ) \]
Mathematica. Time used: 0.042 (sec). Leaf size: 37
ode=D[y[x],{x,2}]-y[x]==Exp[x]*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_1 e^x+c_2 e^{-x}-\frac {1}{8} e^x (\sin (2 x)+\cos (2 x)+2) \]
Sympy. Time used: 0.179 (sec). Leaf size: 26
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_{2} e^{- x} + \left (C_{1} - \frac {\sin {\left (2 x \right )}}{8} - \frac {\cos {\left (2 x \right )}}{8}\right ) e^{x} \]