3.9.6.0.6 Example 6 \(xy^{\prime \prime }+2y^{\prime }-xy=0\)

\begin{equation} xy^{\prime \prime }+2y^{\prime }-xy=0 \tag {1}\end{equation}
In the form \(y^{\prime \prime }+p\left ( x\right ) y^{\prime }+q\left ( x\right ) y=r\left ( x\right ) \) then
\begin{equation} y^{\prime \prime }+\frac {2}{x}y^{\prime }-y=0 \tag {1A}\end{equation}
Where now \(p=\frac {2}{x},q=-1,r=0\). Hence (6A) is
\begin{align*} z & =e^{-\int \frac {p}{2}dx}\\ & =e^{-\int \frac {1}{x}dx}\\ & =\frac {1}{x}\end{align*}

Now we check if Liouville ode invariant \(q_{1}\) is constant.

\begin{align*} q_{1} & =q-\frac {1}{2}p^{\prime }-\frac {1}{4}p^{2}\\ & =\left ( -1\right ) -\frac {1}{2}\left ( \frac {2}{x}\right ) ^{\prime }-\frac {1}{4}\left ( \frac {2}{x}\right ) ^{2}\\ & =-1-\left ( -\frac {1}{x^{2}}\right ) -\frac {1}{x^{2}}\\ & =-1+\frac {1}{x^{2}}-\frac {1}{x^{2}}\\ & =-1 \end{align*}

Since \(q_{1}\) is constant, then we can use the change of the variable \(y=v\left ( x\right ) z\left ( x\right ) \) which is

\begin{align*} y & =v\left ( x\right ) z\left ( x\right ) \\ & =v\frac {1}{x}\end{align*}

Substituting the above into the original ODE (1A) gives

\begin{align*} y^{\prime \prime }+\frac {2}{x}y^{\prime }-y & =0\\ \left ( v\frac {1}{x}\right ) ^{\prime \prime }+\frac {2}{x}\left ( v\frac {1}{x}\right ) ^{\prime }-v\frac {1}{x} & =0 \end{align*}

Carrying out the simplification gives

\[ v^{\prime \prime }-v=0 \]
Which is constant coefficient ode. This is easily solved giving the solution
\[ v=c_{1}e^{x}+c_{2}e^{-x}\]
Hence
\begin{align*} y & =v\left ( x\right ) z\left ( x\right ) \\ & =\left ( c_{1}e^{x}+c_{2}e^{-x}\right ) \frac {1}{x}\end{align*}