89.5.30 problem 30

Internal problem ID [24380]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Exercises at page 43
Problem number : 30
Date solved : Thursday, October 02, 2025 at 10:22:43 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} L i^{\prime }+R i&=e \sin \left (w t \right ) \end{align*}

With initial conditions

\begin{align*} i \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.017 (sec). Leaf size: 45
ode:=L*diff(i(t),t)+R*i(t) = e*sin(w*t); 
ic:=[i(0) = 0]; 
dsolve([ode,op(ic)],i(t), singsol=all);
 
\[ i = \frac {e \left (L w \,{\mathrm e}^{-\frac {R t}{L}}-L \cos \left (w t \right ) w +\sin \left (w t \right ) R \right )}{w^{2} L^{2}+R^{2}} \]
Mathematica. Time used: 0.062 (sec). Leaf size: 47
ode=L*D[i[t],t]+R*i[t]== e*Sin[w*t]; 
ic={i[0]==0}; 
DSolve[{ode,ic},i[t],t,IncludeSingularSolutions->True]
 
\begin{align*} i(t)&\to \frac {e \left (L w e^{-\frac {R t}{L}}-L w \cos (t w)+R \sin (t w)\right )}{L^2 w^2+R^2} \end{align*}
Sympy. Time used: 0.160 (sec). Leaf size: 63
from sympy import * 
t = symbols("t") 
L = symbols("L") 
R = symbols("R") 
e = symbols("e") 
w = symbols("w") 
i = Function("i") 
ode = Eq(L*Derivative(i(t), t) + R*i(t) - e*sin(t*w),0) 
ics = {i(0): 0} 
dsolve(ode,func=i(t),ics=ics)
 
\[ i{\left (t \right )} = - \frac {L e w \cos {\left (t w \right )}}{L^{2} w^{2} + R^{2}} + \frac {L e w e^{- \frac {R t}{L}}}{L^{2} w^{2} + R^{2}} + \frac {R e \sin {\left (t w \right )}}{L^{2} w^{2} + R^{2}} \]