How to solve the ode once it is determined it is exact
Examples finding first integral \(R\left ( x,y,y^{\prime }\right ) \) for an exact second order ode

In the examples above we did not show how to obtain or find the first integral \(R\left ( x,y,y^{\prime }\right ) \). Given an ode \(F\left ( x,y,y^{\prime },y^{\prime \prime }\right ) =0\) which is determined to be exact as above, then how to solve it? This is done by first finding the first integral \(R\). We need to find \(R\left ( x,y,y^{\prime }\right ) \) such that \[ F\left ( x,y,y,y^{\prime \prime }\right ) =\frac {d}{dx}R\left ( x,y,y^{\prime }\right ) =0 \] Once \(R\) is found, then we need to solve the first order ode \(R\left ( x,y,y^{\prime }\right ) =c\) where \(R\) is now one order less that \(F\) so it should be simpler to solve. This ode might require another integration factor to solve depending on what it type turns out to be.

This reduces the order of the ode from second to first order (since \(R\) is first order). To find \(R\left ( x,y,y^{\prime }\right ) \) the first step is to write the given ode in this form\begin {equation} F\left ( x,y,y^{\prime },y^{\prime \prime }\right ) =f\left ( x,y,y^{\prime }\right ) y^{\prime \prime }+g\left ( x,y,y^{\prime }\right ) \tag {1} \end {equation} We know what \(f,g\) are in the above by reading them from the given ode. But\begin {align} F & =\frac {d}{dx}R\left ( x,y,y^{\prime }\right ) \nonumber \\ & =\frac {\partial R}{\partial x}\frac {dx}{dx}+\frac {\partial R}{\partial y}\frac {dy}{dx}+\frac {\partial R}{\partial y^{\prime }}\frac {dy^{\prime }}{dx}\nonumber \\ & =R_{x}+R_{y}y^{\prime }+R_{y^{\prime }}y^{\prime \prime } \tag {1A} \end {align}

And since \(y^{\prime \prime }=\Phi \left ( x,y,y^{\prime }\right ) \) then the above can also be written as\[ F=R_{x}+R_{y}y^{\prime }+\Phi R_{y^{\prime }}\] The above is same as Eq (1B) in the introduction above. Comparing (1,1A) shows that \begin {align} f & =R_{y^{\prime }}\tag {2}\\ g & =R_{x}+R_{y}y^{\prime } \tag {3} \end {align}

At this point it is easier to replace \(y^{\prime }\) by \(p\). The above becomes \begin {align} f & =R_{p}\tag {2}\\ g & =R_{x}+R_{y}p \tag {3} \end {align}

Using (2,3) we are able to determine \(R\). Note that \(R\) must exist since we checked the ode is exact and hence must have a first integral. This method similar to how we find \(R\) for an exact first order ode.

Starting with (2) and integrating it w.r.t. \(p\) gives\begin {equation} R=\int fdp+\psi \left ( x,y\right ) \tag {4} \end {equation} Where \(\psi \left ( x,y\right ) \) acts like an integration constant but since \(R\) depends on more than one variable, it is now an arbitrary function of the other variables \(x,y\). If we can find \(\psi \left ( x,y\right ) \), then \(R\) is found, since \(f\) is known. To find \(\psi \,\), we differentiate one time w.r.t. \(x\) and another time w.r.t. \(y\) and substitute the result in (3). This gives\begin {equation} g=\left ( \frac {\partial }{\partial x}\left ( \int fdp\right ) +\psi _{x}\left ( x,y\right ) \right ) +\left ( \frac {\partial }{\partial y}\left ( \int fdp\right ) +\psi _{y}\left ( x,y\right ) \right ) p \tag {5} \end {equation} In the above the terms \(\frac {\partial }{\partial x}\left ( \int fdp\right ) ,\frac {\partial }{\partial y}\left ( \int fdp\right ) \) are known, since everything is known. The only unknowns are \(\psi _{x}\left ( x,y\right ) ,\psi _{y}\left ( x,y\right ) \). Comparing terms in (5) we can generate two equations for \(\psi _{x},\psi _{y}\) and by integrating them we find \(\psi \). Examples below show how to do this as this is easier explained using examples.