49.2.9 problem 5

Internal problem ID [7599]
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 : 5
Date solved : Wednesday, March 05, 2025 at 04:47:32 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} L y^{\prime }+R y&=E \,{\mathrm e}^{i \omega x} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0 \end{align*}

Maple. Time used: 0.027 (sec). Leaf size: 36
ode:=L*diff(y(x),x)+R*y(x) = E*exp(I*omega*x); 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {E \left ({\mathrm e}^{\frac {x \left (i L \omega +R \right )}{L}}-1\right ) {\mathrm e}^{-\frac {R x}{L}}}{i L \omega +R} \]
Mathematica. Time used: 0.113 (sec). Leaf size: 43
ode=L*D[y[x],x]+R*y[x]==E0*Exp[I*\[Omega]*x]; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\text {E0} e^{-\frac {R x}{L}} \left (-1+e^{\frac {x (R+i L \omega )}{L}}\right )}{R+i L \omega } \]
Sympy. Time used: 0.282 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
E = symbols("E") 
L = symbols("L") 
R = symbols("R") 
omega = symbols("omega") 
y = Function("y") 
ode = Eq(L*Derivative(y(x), x) + R*y(x) - E*exp(omega*x*complex(0, 1)),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {e^{\omega x \operatorname {complex}{\left (0,1 \right )} + 1}}{L \omega \operatorname {complex}{\left (0,1 \right )} + R} - \frac {e e^{- \frac {R x}{L}}}{L \omega \operatorname {complex}{\left (0,1 \right )} + R} \]