3.9.8.2 Example 2. Euler ODE \(x^{2}y^{\prime \prime }\left ( x\right ) +xy^{\prime }\left ( x\right ) +y\left ( x\right ) =0\)

One way to solve Euler ODE 

\begin{equation} x^{2}y^{\prime \prime }\left ( x\right ) +xy^{\prime }\left ( x\right ) +y\left ( x\right ) =0 \tag {A}\end{equation}
Putting it in normal form gives
\[ y^{\prime \prime }\left ( x\right ) +\frac {1}{x}y^{\prime }\left ( x\right ) +\frac {1}{x^{2}}y\left ( x\right ) =0 \]
Hence
\begin{align*} p & =\frac {1}{x}\\ q & =\frac {1}{x^{2}}\\ r & =0 \end{align*}

Trying change of variable on the independent variable.  Let \(\tau =g\left ( x\right ) \) where \(\tau \) will be the new independent variable. Applying this transformation results in

\begin{equation} y^{\prime \prime }+p_{1}y^{\prime }+q_{1}y=r_{1} \tag {1}\end{equation}
Where
\begin{align} p_{1}\left ( \tau \right ) & =\frac {\tau ^{\prime \prime }\left ( x\right ) +p\left ( x\right ) \tau ^{\prime }\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\tag {2}\\ q_{1}\left ( \tau \right ) & =\frac {q\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\tag {3}\\ r_{1}\left ( \tau \right ) & =\frac {r\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}} \tag {4}\end{align}

Approach 1. Let \(q_{1}=c^{2}\) where \(c^{2}\) is some constant. This implies

\begin{align} \frac {q}{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}} & =c^{2}\nonumber \\ \tau & =\frac {1}{c}\int \sqrt {q}dx \tag {5}\end{align}

If with this \(\tau \), then \(p_{1}\) turns out to be constant, then (1) is now a second order constant coefficient ode which is easily solved. Applying (5) on the given ode gives

\begin{align*} \tau & =\frac {1}{c}\int \sqrt {x^{-2}}dx\\ & =\frac {1}{c}\ln x \end{align*}

Using the above on (2) gives

\begin{align*} p_{1}\left ( \tau \right ) & =\frac {\tau ^{\prime \prime }\left ( x\right ) +p\tau ^{\prime }\left ( x\right ) }{\left ( \tau ^{\prime }\left ( x\right ) \right ) ^{2}}\\ & =0 \end{align*}

Which is a constant. Hence this transformation worked.  Therefore(1) becomes (using \(q_{1}=c^{2}\) which is a constant \(c^{2}\))

\begin{align*} y^{\prime \prime }\left ( \tau \right ) +p_{1}y^{\prime }\left ( \tau \right ) +q_{1}y\left ( \tau \right ) & =r_{1}\\ y^{\prime \prime }\left ( \tau \right ) +c^{2}y\left ( \tau \right ) & =0 \end{align*}

The solution is

\[ y\left ( \tau \right ) =A\cos \left ( c\tau \right ) +B\sin \left ( c\tau \right ) \]
But \(\tau =\frac {1}{c}\ln x\). Hence the above becomes
\[ y\left ( x\right ) =A\cos \left ( \ln x\right ) +B\sin \left ( \ln x\right ) \]
In practice, this longer method is not needed to solve Euler ode \(x^{2}y^{\prime \prime }\left ( x\right ) +xy^{\prime }\left ( x\right ) +y\left ( x\right ) =0\) as that the substitution \(y=x^{r}\) works more easily. But the above method is more general. For example, using \(y=x^{r}\), then \(x^{2}y^{\prime \prime }\left ( x\right ) +xy^{\prime }\left ( x\right ) +y\left ( x\right ) =0\) becomes \(r\left ( r-1\right ) +r+1=0\). The roots \(r\) are \(i,-i\). Then the solution is linear combination of the basis solutions given by
\begin{align*} y & =Ax^{i}+Bx^{-i}\\ & =Ae^{\ln x^{i}}+Be^{\ln x^{-i}}\\ & =Ae^{i\ln x}+Be^{-i\ln x}\\ & =A\cos \left ( \ln x\right ) +B\sin \left ( \ln x\right ) \end{align*}

Where the last step used Euler relation to do the conversion. Another known transformation for Euler (which is not as simple as the above) is to use \(x=e^{t}\). Using this gives

\begin{equation} \frac {dx}{dt}=e^{t} \tag {2}\end{equation}
But \(\ln x=t\), hence
\begin{equation} \frac {dt}{dx}=\frac {1}{x} \tag {3}\end{equation}
To do this change of variable and obtain a new ode where now \(y\left ( x\right ) \) becomes \(y\left ( t\right ) \), then \(y^{\prime }\left ( x\right ) \) is changed to \(y^{\prime }\left ( t\right ) \) and \(y^{\prime \prime }\left ( x\right ) \) is changed \(y^{\prime \prime }\left ( t\right ) \). Using
\begin{equation} \frac {dy}{dx}=\frac {dy}{dt}\frac {dt}{dx} \tag {4}\end{equation}
Substituting (3) into (4) gives
\[ \frac {dy}{dx}=\frac {dy}{dt}\frac {1}{x}\]
But \(\frac {1}{x}=e^{-t}\). The above becomes
\begin{equation} \frac {dy}{dx}=e^{-t}\frac {dy}{dt} \tag {5}\end{equation}
Now \(y^{\prime \prime }\left ( x\right ) \) needs to change to \(y^{\prime \prime }\left ( t\right ) \). Since
\[ \frac {d^{2}y}{dx^{2}}=\frac {d}{dx}\left ( \frac {dy}{dx}\right ) \]
Substituting (5) into the above gives
\[ \frac {d^{2}y}{dx^{2}}=\frac {d}{dx}\left ( e^{-t}\frac {dy}{dt}\right ) \]
Dividing the numerator and denominator of \(\frac {d}{dx}\) by \(dt\) gives
\begin{align*} \frac {d^{2}y}{dx^{2}} & =\frac {\frac {d}{dt}}{\frac {dx}{dt}}\left ( e^{-t}\frac {dy}{dt}\right ) \\ & =\frac {dt}{dx}\frac {d}{dt}\left ( e^{-t}\frac {dy}{dt}\right ) \end{align*}

But from (3) \(\frac {dt}{dx}=\frac {1}{x}=e^{-t}\). Hence the above becomes

\[ \frac {d^{2}y}{dx^{2}}=e^{-t}\frac {d}{dt}\left ( e^{-t}\frac {dy}{dt}\right ) \]
Using the the product rule gives
\begin{align} \frac {d^{2}y}{dx^{2}} & =e^{-t}\left ( -e^{-t}\frac {dy}{dt}+e^{-t}\frac {d^{2}y}{dt^{2}}\right ) \nonumber \\ & =e^{-2t}\left ( -\frac {dy}{dt}+\frac {d^{2}y}{dt^{2}}\right ) \nonumber \\ & =e^{-2t}\left ( \frac {d^{2}y}{dt^{2}}-\frac {dy}{dt}\right ) \tag {6}\end{align}

Now \(y^{\prime }\left ( x\right ) \) and \(y^{\prime \prime }\left ( x\right ) \) have been converted to \(y^{\prime }\left ( t\right ) ,y^{\prime \prime }\left ( t\right ) \). Substituting (5,6) in the gives ode gives

\begin{align*} x^{2}y^{\prime \prime }\left ( x\right ) +xy^{\prime }\left ( x\right ) +y\left ( x\right ) & =0\\ x^{2}e^{-2t}\left ( \frac {d^{2}y}{dt^{2}}-\frac {dy}{dt}\right ) +xe^{-t}\frac {dy}{dt}+y\left ( t\right ) & =0 \end{align*}

But \(x=e^{t}\) and \(x^{2}=e^{2t}\). The above becomes

\begin{align*} \frac {d^{2}y}{dt^{2}}-\frac {dy}{dt}+\frac {dy}{dt}+y\left ( t\right ) & =0\\ \frac {d^{2}y}{dt^{2}}+y\left ( t\right ) & =0 \end{align*}

This is now constant coefficient ODE. The solution is

\[ y\left ( t\right ) =A\cos \left ( t\right ) +B\sin \left ( t\right ) \]
Since\(\ \ln x=t\), then the above becomes
\[ y\left ( x\right ) =A\cos \left ( \ln x\right ) +B\sin \left ( \ln x\right ) \]
This completes the solution.