49.2.8 problem 4

Internal problem ID [7598]
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 : Wednesday, March 05, 2025 at 04:47:29 AM
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.019 (sec). Leaf size: 45
ode:=L*diff(y(x),x)+R*y(x) = E*sin(omega*x); 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {E \left ({\mathrm e}^{-\frac {R x}{L}} \omega 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.101 (sec). Leaf size: 47
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]
 
\[ y(x)\to \frac {\text {e0} \left (L \omega e^{-\frac {R x}{L}}-L \omega \cos (x \omega )+R \sin (x \omega )\right )}{L^2 \omega ^2+R^2} \]
Sympy. Time used: 0.313 (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}} \]