43.2.8 problem 4

Internal problem ID [8884]
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 : 4
Date solved : Tuesday, September 30, 2025 at 05:58:54 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} L y^{\prime }+R y&=E \sin \left (\omega x \right ) \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.038 (sec). Leaf size: 45
ode:=L*diff(y(x),x)+R*y(x) = E*sin(omega*x); 
ic:=[y(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {E \left (L \omega \,{\mathrm e}^{-\frac {R x}{L}}-L \cos \left (\omega x \right ) \omega +\sin \left (\omega x \right ) R \right )}{\omega ^{2} L^{2}+R^{2}} \]
Mathematica. Time used: 0.05 (sec). Leaf size: 41
ode=L*D[y[x],x]+R*y[x]==e0*Sin[\[Omega]*x]; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-\frac {R x}{L}} \int _0^x\frac {e^{\frac {R K[1]}{L}} \text {e0} \sin (\omega K[1])}{L}dK[1] \end{align*}
Sympy. Time used: 0.155 (sec). Leaf size: 68
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*sin(omega*x),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {e L \omega \cos {\left (\omega x \right )}}{L^{2} \omega ^{2} + R^{2}} + \frac {e L \omega e^{- \frac {R x}{L}}}{L^{2} \omega ^{2} + R^{2}} + \frac {e R \sin {\left (\omega x \right )}}{L^{2} \omega ^{2} + R^{2}} \]