1.3.7 Example 7 \(ty^{\prime }+y=\sin \left ( t\right ) ,y\left ( 1\right ) =0\)
\begin{align*} ty^{\prime }+y & =\sin \left ( t\right ) \\ y\left ( 1\right ) & =0 \end{align*}

Change of variables is made to make the IC at zero. Let \(\tau =t-1\). The ode becomes

\begin{align*} \left ( 1+\tau \right ) y^{\prime }\left ( \tau \right ) +y\left ( \tau \right ) & =\sin \left ( 1+\tau \right ) \\ y^{\prime }\left ( \tau \right ) +\tau y^{\prime }\left ( \tau \right ) +y\left ( \tau \right ) & =\sin \left ( 1+\tau \right ) \\ y\left ( 0\right ) & =0 \end{align*}

Converting the above new ode to Laplace domain using

\[\mathcal {L}\left ( tf\left ( \tau \right ) \right ) =-\frac {d}{ds}F\left ( s\right ) \]

Gives (using \(Y\left ( s\right ) \) as the Laplace of \(y\left ( \tau \right ) \))

\begin{align*} \left ( sY-y\left ( 0\right ) \right ) +\left ( -1\right ) \frac {d}{ds}\left ( sY-y\left ( 0\right ) \right ) +Y & =\frac {\sin \left ( 1\right ) s+\cos \left ( 1\right ) }{1+s^{2}}\\ sY-y\left ( 0\right ) -\left ( Y+s\frac {dY}{ds}\right ) +Y & =\frac {\sin \left ( 1\right ) s+\cos \left ( 1\right ) }{1+s^{2}}\\ sY-0-Y-s\frac {dY}{ds}+Y & =\frac {\sin \left ( 1\right ) s+\cos \left ( 1\right ) }{1+s^{2}}\\ sY-s\frac {d}{ds}Y & =\frac {\sin \left ( 1\right ) s+\cos \left ( 1\right ) }{1+s^{2}}\\ \frac {d}{ds}Y-Y & =-\frac {\sin \left ( 1\right ) s+\cos \left ( 1\right ) }{s\left ( 1+s^{2}\right ) }\end{align*}

The above is linear ode. Solving it gives

\begin{align} Y & =\frac {e^{s}}{2}\left ( 2\operatorname {Ei}\left ( 1,s\right ) \cos \left ( 1\right ) -\operatorname {Ei}\left ( 1,s+i\right ) -\operatorname {Ei}\left ( 1,s-i\right ) +2c_{1}\right ) \nonumber \\ & =e^{s}\operatorname {Ei}\left ( 1,s\right ) \cos \left ( 1\right ) -\frac {e^{s}}{2}\operatorname {Ei}\left ( 1,s+i\right ) -\frac {e^{s}}{2}\operatorname {Ei}\left ( 1,s-i\right ) +c_{1}e^{s} \tag {1}\end{align}

Taking inverse Laplace transform gives

\begin{equation} y\left ( \tau \right ) =\frac {\cos 1}{\tau +1}-\frac {\cos \left ( \tau +1\right ) }{\tau +1}+c_{1}\mathcal {L}^{-1}\left ( e^{s}\right ) \tag {4}\end{equation}

Applying IC \(y\left ( 0\right ) =0\)

\begin{align*} 0 & =\cos \left ( 1\right ) -\cos \left ( 1\right ) +c_{1}\mathcal {L}^{-1}\left ( e^{s}\right ) \\ 0 & =c_{1}\mathcal {L}^{-1}\left ( e^{s}\right ) \end{align*}

Hence \(c_{1}=0\). Therefore (3) becomes

\[ y\left ( \tau \right ) =\frac {\cos 1}{\tau +1}-\frac {\cos \left ( \tau +1\right ) }{\tau +1}\]

Going back to \(t\) using \(\tau =t-1\) the above becomes

\[ y\left ( t\right ) =\frac {\cos 1}{t}-\frac {\cos \left ( t\right ) }{t}\]