49.2.6 problem 2

Internal problem ID [7596]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 1.6 Introduction– Linear equations of First Order. Page 41
Problem number : 2
Date solved : Wednesday, March 05, 2025 at 04:47:26 AM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=diff(y(x),x)+I*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -i x +1+{\mathrm e}^{-i x} c_{1} \]
Mathematica. Time used: 0.051 (sec). Leaf size: 22
ode=D[y[x],x]+I*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -i x+c_1 e^{-i x}+1 \]
Sympy. Time used: 0.177 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + complex(0, 1)*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x \operatorname {complex}{\left (0,1 \right )}} + \frac {x}{\operatorname {complex}{\left (0,1 \right )}} - \frac {1}{\operatorname {complex}^{2}{\left (0,1 \right )}} \]