43.11.7 problem 1(g)

Internal problem ID [8957]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 2. Linear equations with constant coefficients. Page 93
Problem number : 1(g)
Date solved : Tuesday, September 30, 2025 at 06:00:32 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+i y^{\prime }+2 y&=2 \cosh \left (2 x \right )+{\mathrm e}^{-2 x} \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)+I*diff(y(x),x)+2*y(x) = 2*cosh(2*x)+exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{i x} c_2 +{\mathrm e}^{-2 i x} c_1 +\left (\frac {3}{10}+\frac {i}{10}\right ) {\mathrm e}^{-2 x}+\left (\frac {3}{20}-\frac {i}{20}\right ) {\mathrm e}^{2 x} \]
Mathematica. Time used: 0.134 (sec). Leaf size: 48
ode=D[y[x],{x,2}]+I*D[y[x],x]+2*y[x]==2*Cosh[2*x]+Exp[-2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{20} e^{-2 x} \left ((3-i) e^{4 x}+(6+2 i)\right )+c_1 e^{-2 i x}+c_2 e^{i x} \end{align*}
Sympy. Time used: 0.421 (sec). Leaf size: 85
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(complex(0, 1)*Derivative(y(x), x) + 2*y(x) - 2*cosh(2*x) + Derivative(y(x), (x, 2)) - exp(-2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{\frac {x \left (\sqrt {\operatorname {complex}^{2}{\left (0,1 \right )} - 8} - \operatorname {complex}{\left (0,1 \right )}\right )}{2}} + C_{2} e^{- \frac {x \left (\sqrt {\operatorname {complex}^{2}{\left (0,1 \right )} - 8} + \operatorname {complex}{\left (0,1 \right )}\right )}{2}} + \frac {\operatorname {complex}{\left (0,1 \right )} \sinh {\left (2 x \right )}}{\operatorname {complex}^{2}{\left (0,1 \right )} - 9} - \frac {3 \cosh {\left (2 x \right )}}{\operatorname {complex}^{2}{\left (0,1 \right )} - 9} - \frac {e^{- 2 x}}{2 \left (\operatorname {complex}{\left (0,1 \right )} - 3\right )} \]