2.5 Linear ode

2.5.1 Examples
\[ y^{\prime }+p\left ( x\right ) y=q\left ( x\right ) \]
ode internal name "linear"

Solved by finding integration factor

\[ \mu =e^{\int p\left ( x\right ) dx}\]
The ode then becomes \(\frac {d}{dx}\left ( \mu y\right ) =\mu q\). Left side is not complete differential. Hence integrating both sides gives
\begin{align*} \mu y & =\int \mu qdx+c\\ y & =\left ( \int \mu qdx+c\right ) \frac {1}{\mu }\\ & =\left ( \int q\left ( x\right ) e^{\int p\left ( x\right ) dx}dx+c\right ) e^{\int -p\left ( x\right ) dx}\end{align*}

If \(\mu \) can not be evaluated explicitly then the integration factor is written as

\[ \mu =e^{\int _{0}^{x}p\left ( \tau \right ) d\tau }\]
And the solution become
\[ y=\left ( \int _{0}^{x}q\left ( \tau \right ) e^{\int _{0}^{x}p\left ( \tau \right ) d\tau }d\tau +c\right ) e^{\int _{0}^{x}-p\left ( \tau \right ) d\tau }\]
For an example, if the ode was \(y^{\prime }+p\left ( x\right ) y=\sin \left ( x\right ) \) then the solution is
\[ y=\left ( \int _{0}^{x}\sin \left ( \tau \right ) e^{\int _{0}^{\tau }p\left ( \tau \right ) d\tau }d\tau +c\right ) e^{\int _{0}^{x}-p\left ( \tau \right ) d\tau }\]
On the other hand, If \(\mu \) can be evaluated explicitly (i.e. the integration can be done) but \(\int \mu qdx\) can not (may be because \(q\left ( x\right ) \) is too complicated or given as unknown function, then the solution is
\[ y=\left ( \int _{0}^{x}q\left ( \tau \right ) \mu \left ( \tau \right ) d\tau +c\right ) \frac {1}{\mu \left ( x\right ) }\]
For an example, given ode \(y^{\prime }+\sin \left ( x\right ) y=q\left ( x\right ) \) then the solution is
\[ y=\left ( \int _{0}^{x}q\left ( \tau \right ) e^{-\cos \left ( \tau \right ) }d\tau +c\right ) e^{\cos \left ( x\right ) }\]

In all the above, now the constant of integration can be solved for, if initial condition is given.