4.4.6.1 Introduction

This shows how to solve the nonlinear second order ode of the form

\begin{equation} y^{\prime \prime }\left ( x\right ) +p\left ( x\right ) y^{\prime }\left ( x\right ) +q\left ( y\right ) \left ( y^{\prime }\left ( x\right ) \right ) ^{2}=0 \tag {1}\end{equation}

For this method to work, in the above \(p\left ( x\right ) \) must be either a function of \(x\) or a constant. It can not depend on \(y\). And in the term \(q\left ( y\right ) \left [ y^{\prime }\left ( x\right ) \right ] ^{2}\), \(q\left ( y\right ) \) must be only a function of \(y\) or a constant. It can not depend on \(x\).

For an example this method will work on \(y^{\prime \prime }+y^{\prime }+yy^{2}=0\) and on \(y^{\prime \prime }+\sin \left ( x\right ) y^{\prime }\left ( x\right ) +y\left ( y^{\prime }\right ) ^{2}=0\) and on \(y^{\prime \prime }+\sin \left ( x\right ) y^{\prime }+\left ( 1+y\right ) \left ( y^{\prime }\right ) ^{2}=0\) but not on \(y^{\prime \prime }+y^{\prime }+xyy^{2}=0\) and not on \(y^{\prime \prime }+\sin \left ( y\right ) y^{\prime }+yy^{2}=0\).

This is implemented in my ode solver as type 18. The first step is to divide (1) by \(y^{\prime }\left ( x\right ) \) which gives

\begin{align} \frac {y^{\prime \prime }}{y^{\prime }}+p\left ( x\right ) +q\left ( y\right ) y^{\prime } & =0\tag {2}\\ \frac {y^{\prime \prime }}{y^{\prime }} & =-q\left ( y\right ) y^{\prime }-p\left ( x\right ) \tag {3}\end{align}

The LHS is \(\frac {d}{dx}\left ( \ln y^{\prime }\right ) \) and the term \(q\left ( y\right ) y^{\prime }\left ( x\right ) \) is \(\left ( \frac {d}{dy}\int q\left ( y\right ) dy\right ) \frac {dy}{dx}=\frac {d}{dx}\int q\left ( y\right ) dy\). This is the reason why \(q\) can not depend on \(x\), In order to be able to evaluate the integral. Using this (3) now becomes

\begin{align*} \frac {y^{\prime \prime }}{y^{\prime }} & =-\left ( \frac {d}{dx}\int q\left ( y\right ) dy\right ) -p\left ( x\right ) \\ \frac {d}{dx}\left ( \ln y^{\prime }\right ) & =-\left ( \frac {d}{dx}\int q\left ( y\right ) dy\right ) -p\left ( x\right ) \\ \frac {d}{dx}\left ( \ln y^{\prime }\right ) +\frac {d}{dx}\int q\left ( y\right ) dy & =-p\left ( x\right ) \\ \frac {d}{dx}\left ( \ln y^{\prime }+\int q\left ( y\right ) dy\right ) & =-p\left ( x\right ) \end{align*}

Integrating gives

\begin{equation} \ln y^{\prime }+\int q\left ( y\right ) dy=-\int p\left ( x\right ) dx \tag {4}\end{equation}

And this is the reason why \(p\) can not depend on \(y\). In order to able to integrate the RHS above. Once \(\int q\left ( y\right ) dy\) and \(\int p\left ( x\right ) dx\) are evaluated, then \(y^{\prime }\) is found and this gives first order ode in \(y\) which is easily solved.