49.6.4 problem 1(d)

Internal problem ID [7632]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 2. Linear equations with constant coefficients. Page 69
Problem number : 1(d)
Date solved : Wednesday, March 05, 2025 at 04:48:50 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+2 i y^{\prime }+y&=x \end{align*}

Maple. Time used: 0.009 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)+2*I*diff(y(x),x)+y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-i x} \sin \left (\sqrt {2}\, x \right ) c_{2} +{\mathrm e}^{-i x} \cos \left (\sqrt {2}\, x \right ) c_{1} -2 i+x \]
Mathematica. Time used: 0.022 (sec). Leaf size: 44
ode=D[y[x],{x,2}]+2*I*D[y[x],x]+y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x+c_1 e^{-i \left (1+\sqrt {2}\right ) x}+c_2 e^{i \left (\sqrt {2}-1\right ) x}-2 i \]
Sympy. Time used: 0.298 (sec). Leaf size: 48
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + complex(0, 2)*Derivative(y(x), x) + y(x) + Derivative(y(x), (x, 2)),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,2 \right )} - 4} - \operatorname {complex}{\left (0,2 \right )}\right )}{2}} + C_{2} e^{- \frac {x \left (\sqrt {\operatorname {complex}^{2}{\left (0,2 \right )} - 4} + \operatorname {complex}{\left (0,2 \right )}\right )}{2}} + x - \operatorname {complex}{\left (0,2 \right )} \]