Examples finding first integral \(R\left ( x,y,y^{\prime }\right ) \) for an exact second order ode

Example 1 \[ yy^{\prime \prime }+\left ( y^{\prime }\right ) ^{2}+2axyy^{\prime }+ay^{2}=0 \] Comparing this to  \(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 ) \) shows that\begin {align*} f & =y\\ g & =\left ( y^{\prime }\right ) ^{2}+2axyy^{\prime }+ay^{2}\\ & =p^{2}+2axyp+ay^{2} \end {align*}

Therefore (4) becomes\begin {align} R & =\int fdp+\psi \left ( x,y\right ) \nonumber \\ & =yp+\psi \left ( x,y\right ) \tag {1A} \end {align}

Hence (5) becomes\begin {align*} g & =\left ( \frac {\partial }{\partial x}\left ( \int fdp\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( \int fdp\right ) +\psi _{y}\right ) p\\ p^{2}+2axyp+ay^{2} & =\left ( \frac {\partial }{\partial x}\left ( yp\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( yp\right ) +\psi _{y}\right ) p \end {align*}

But \(\frac {\partial }{\partial x}\left ( yp\right ) =0\) since \(y,p\) are held constant. It is important to watch for this here. Given \(f\left ( x,y\right ) =3x+y\left ( x\right ) \) where \(y\) is function of \(x\), then when we do \(\frac {\partial f}{\partial x}\) the result is \(3\) and not \(3+y^{\prime }\) because with partial derivatives the \(y\) is held constant. Similarly \(\frac {\partial }{\partial y}\left ( yp\right ) =p^{2}\). The above becomes\begin {align*} p^{2}+2axyp+ay^{2} & =\psi _{x}+\left ( p+\psi _{y}\right ) p\\ & =\psi _{x}+p^{2}+\psi _{y}p\\ 2axyp+ay^{2} & =\psi _{x}+\psi _{y}p \end {align*}

Comparing terms shows that\begin {align} 2axy & =\psi _{y}\tag {2A}\\ ay^{2} & =\psi _{x} \tag {3A} \end {align}

Integrating (2A) w.r.t \(y\) gives \begin {equation} \psi =axy^{2}+h\left ( x\right ) \tag {4A} \end {equation} Differentiating the above w.r.t. \(x\) gives \(\psi _{x}=ay^{2}+h^{\prime }\left ( x\right ) \). comparing this to (3A) above gives \(ay^{2}=ay^{2}+h^{\prime }\left ( x\right ) \), hence \(h^{\prime }\left ( x\right ) =0\) or \(h\left ( x\right ) =c\). Therefore (4A) becomes \[ \psi =axy^{2}+c \] Substituting the above in (1A) gives\[ R=yp+axy^{2}+c \] Therefore, since \(R=c_{1}\) a constant, then the above becomes (by merging the constants)\begin {align*} yp+axy^{2} & =c_{2}\\ yy^{\prime }+axy^{2} & =c_{2} \end {align*}

This is the reduced ode which needs to be solved for \(y\). The above says that \(R=yy^{\prime }+axy^{2}+c_{2}\). To verify, let us apply \(F=\frac {d}{dx}R\). This gives

\begin {align*} yy^{\prime \prime }+\left ( y^{\prime }\right ) ^{2}+2axyy^{\prime }+ay^{2} & =\frac {d}{dx}\left ( yy^{\prime }+axy^{2}+c_{2}\right ) \\ & =y^{\prime }y^{\prime }+yy^{\prime \prime }+ay^{2}+2axyy^{\prime }\\ & =yy^{\prime \prime }+\left ( y^{\prime }\right ) ^{2}+2axyy^{\prime }+ay^{2} \end {align*}

Verified.

Example 2 \begin {align*} y^{\prime \prime }+xy^{\prime }+y & =0\\ F\left ( x,y,y^{\prime },y^{\prime \prime }\right ) & =0 \end {align*} This ode is not nonlinear, but let us apply this method to it anyway. First we need to determine if it is exact or not.  Applying the test\begin {align*} \frac {\partial F}{\partial y}-\frac {d}{dx}\left ( \frac {\partial F}{\partial y^{\prime }}\right ) +\frac {d^{2}}{dx^{2}}\left ( \frac {\partial F}{\partial y^{\prime \prime }}\right ) & =0\\ 1-\frac {d}{dx}\left ( x\right ) +\frac {d^{2}}{dx^{2}}\left ( 1\right ) & =0\\ 1-1 & =0\\ 0 & =0 \end {align*}

So it exact. Comparing this ode to  \(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 ) \) shows that\begin {align*} f & =1\\ g & =xy^{\prime }+y\\ & =xp+y \end {align*}

Therefore (4) becomes\begin {align} R & =\int fdp+\psi \left ( x,y\right ) \nonumber \\ & =p+\psi \left ( x,y\right ) \tag {1A} \end {align}

Hence (5) becomes\begin {align*} g & =\left ( \frac {\partial }{\partial x}\left ( \int fdp\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( \int fdp\right ) +\psi _{y}\right ) p\\ xp+y & =\left ( \frac {\partial p}{\partial x}+\psi _{x}\right ) +\left ( \frac {\partial p}{\partial y}+\psi _{y}\right ) p \end {align*}

But \(\frac {\partial p}{\partial x}=0\) since \(y\) is held constant. And \(\frac {\partial p}{\partial y}=0\). The above becomes\[ xp+y=\psi _{x}+\psi _{y}p \] Comparing terms shows that\begin {align*} x & =\psi _{y}\\ y & =\psi _{x} \end {align*}

Integrating the first equation gives \(\psi =xy+c\). Hence (1A) becomes \[ R=p+xy+c \] Therefore, since \(R=c_{1}\) a constant, then the above becomes (by merging the constants)\begin {align*} p+xy & =c_{2}\\ y^{\prime }+xy & =c_{2} \end {align*}

This is the reduced ode which needs to be solved for \(y\). Solving gives \[ y=\operatorname {erf}\left ( \frac {i\sqrt {2}x}{2}\right ) e^{\frac {-x^{2}}{2}}c_{1}+c_{2}e^{\frac {-x^{2}}{2}}\]

Example 3 \begin {align*} y^{\prime \prime }-2yy^{\prime } & =0\\ F\left ( x,y,y^{\prime },y^{\prime \prime }\right ) & =0 \end {align*} First we need to determine if it is exact or not.  Applying the test\begin {align*} \frac {\partial F}{\partial y}-\frac {d}{dx}\left ( \frac {\partial F}{\partial y^{\prime }}\right ) +\frac {d^{2}}{dx^{2}}\left ( \frac {\partial F}{\partial y^{\prime \prime }}\right ) & =0\\ -2y^{\prime }-\frac {d}{dx}\left ( -2y\right ) +\frac {d^{2}}{dx^{2}}\left ( 1\right ) & =0\\ -2y^{\prime }+2\frac {d}{dx}\left ( y\right ) & =0\\ -2y^{\prime }+2y^{\prime } & =0\\ 0 & =0 \end {align*}

So it exact.  Comparing this ode to  \(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 ) \) shows that\begin {align*} f & =1\\ g & =-2yy^{\prime }\\ & =-2yp \end {align*}

Therefore (4) becomes\begin {align} R & =\int fdp+\psi \left ( x,y\right ) \nonumber \\ & =p+\psi \left ( x,y\right ) \tag {1A} \end {align}

Hence (5) becomes\begin {align*} g & =\left ( \frac {\partial }{\partial x}\left ( \int fdp\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( \int fdp\right ) +\psi _{y}\right ) p\\ -2yp & =\left ( \frac {\partial p}{\partial x}+\psi _{x}\right ) +\left ( \frac {\partial p}{\partial y}+\psi _{y}\right ) p\\ -2yp & =\psi _{x}+\psi _{y}p \end {align*}

Comparing terms shows that\begin {align*} -2y & =\psi _{y}\\ 0 & =\psi _{x} \end {align*}

Integrating the first equation gives \(\psi =-y^{2}+h\left ( x\right ) \). Differentiating this w.r.t. \(x\) gives \(\psi _{x}=h^{\prime }\left ( x\right ) \). comparing this to the second equation above gives \(0=h^{\prime }\left ( x\right ) \), hence \(h\left ( x\right ) =c\). Hence \(\psi =-y^{2}+c\).  Therefore (1A) becomes \[ R=p-y^{2}+c \] Therefore, since \(R=c_{1}\) a constant, then the above becomes (by merging the constants)\begin {align*} p-y^{2} & =c_{2}\\ y^{\prime }-y^{2} & =c_{2} \end {align*}

This is the reduced ode.

Example 4 \begin {align*} \left ( x-1\right ) ^{2}y^{\prime \prime }+4xy^{\prime }+2y-2x & =0\\ F\left ( x,y,y^{\prime },y^{\prime \prime }\right ) & =0 \end {align*} First we need to determine if it is exact or not.  Applying the test\begin {align*} \frac {\partial F}{\partial y}-\frac {d}{dx}\left ( \frac {\partial F}{\partial y^{\prime }}\right ) +\frac {d^{2}}{dx^{2}}\left ( \frac {\partial F}{\partial y^{\prime \prime }}\right ) & =0\\ 2-\frac {d}{dx}\left ( 4x\right ) +\frac {d^{2}}{dx^{2}}\left ( \left ( x-1\right ) ^{2}\right ) & =0\\ 2-4+\frac {d}{dx}\left ( 2\left ( x-1\right ) \right ) & =0\\ 2-4+2 & =0\\ 0 & =0 \end {align*}

So it exact.  Comparing this ode to  \(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 ) \) shows that\begin {align*} f & =\left ( x-1\right ) ^{2}\\ g & =4xy^{\prime }+2y-2x\\ & =4xp+2y-2x \end {align*}

Therefore (4) becomes\begin {align} R & =\int fdp+\psi \left ( x,y\right ) \nonumber \\ & =\left ( x-1\right ) ^{2}p+\psi \left ( x,y\right ) \tag {1A} \end {align}

Hence (5) becomes\begin {align*} g & =\left ( \frac {\partial }{\partial x}\left ( \int fdp\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( \int fdp\right ) +\psi _{y}\right ) p\\ 4xp+2y-2x & =\left ( \frac {\partial }{\partial x}\left ( \left ( x-1\right ) ^{2}p\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( \left ( x-1\right ) ^{2}p\right ) +\psi _{y}\right ) p\\ 4xp+2y-2x & =2p\left ( x-1\right ) +\psi _{x}+\psi _{y}p\\ 4xp+2y-2x & =p\left ( 2\left ( x-1\right ) +\psi _{y}\right ) +\psi _{x} \end {align*}

Comparing terms shows that\begin {align*} 4x & =2\left ( x-1\right ) +\psi _{y}\\ 2y-2x & =\psi _{x} \end {align*}

Or\begin {align*} 2x+2 & =\psi _{y}\\ 2y-2x & =\psi _{x} \end {align*}

Integrating the first equation gives \(\psi =2xy+2y+h\left ( x\right ) \). Differentiating this w.r.t. \(x\) gives \(\psi _{x}=2y+h^{\prime }\left ( x\right ) \). comparing this to the second equation above gives \(2y-2x=2y+h^{\prime }\left ( x\right ) \), hence \(h^{\prime }\left ( x\right ) =-2x\). Hence \(h=-x^{2}+c\). Therefore\(\ \psi =2xy+2y-x^{2}+c\).  Eq (1A) becomes \begin {align*} R & =\left ( x-1\right ) ^{2}p+2xy+2y-x^{2}+c\\ & =\left ( x-1\right ) ^{2}y^{\prime }+2xy+2y-x^{2}+c \end {align*}

Therefore, since \(R=c_{1}\) a constant, then the above becomes (by merging the constants)\[ \left ( x-1\right ) ^{2}y^{\prime }+2xy+2y-x^{2}=c_{2}\] Which is the reduced ode to solve.

Example 5 \begin {align*} y^{\prime \prime }-y^{\prime }e^{y} & =0\\ F\left ( x,y,y^{\prime },y^{\prime \prime }\right ) & =0 \end {align*} First we need to determine if it is exact or not.  Applying the test\begin {align*} \frac {\partial F}{\partial y}-\frac {d}{dx}\left ( \frac {\partial F}{\partial y^{\prime }}\right ) +\frac {d^{2}}{dx^{2}}\left ( \frac {\partial F}{\partial y^{\prime \prime }}\right ) & =0\\ -y^{\prime }e^{y}-\frac {d}{dx}\left ( -e^{y}\right ) +\frac {d^{2}}{dx^{2}}\left ( 1\right ) & =0\\ -y^{\prime }e^{y}+y^{\prime }e^{y} & =0\\ 0 & =0 \end {align*}

So it exact.  Comparing this ode to  \(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 ) \) shows that\begin {align*} f & =1\\ g & =-y^{\prime }e^{y}\\ & =-pe^{y} \end {align*}

Therefore (4) becomes\begin {align} R & =\int fdp+\psi \left ( x,y\right ) \nonumber \\ & =p+\psi \left ( x,y\right ) \tag {1A} \end {align}

Hence (5) becomes\begin {align*} g & =\left ( \frac {\partial }{\partial x}\left ( \int fdp\right ) +\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}\left ( \int fdp\right ) +\psi _{y}\right ) p\\ -pe^{y} & =\left ( \frac {\partial }{\partial x}p+\psi _{x}\right ) +\left ( \frac {\partial }{\partial y}p+\psi _{y}\right ) p\\ -pe^{y} & =\psi _{x}+\psi _{y}p \end {align*}

Comparing terms shows that\begin {align*} -e^{y} & =\psi _{y}\\ 0 & =\psi _{x} \end {align*}

Integrating the first equation gives \(\psi =-e^{y}+h\left ( x\right ) \). Partial differentiating this w.r.t. \(x\) gives \(\psi _{x}=h^{\prime }\left ( x\right ) \). comparing this to the second equation above gives \(h^{\prime }\left ( x\right ) =0\), hence \(h\left ( x\right ) =c\). Hence \(h=-x^{2}+c\). Therefore\(\ \psi =-e^{y}+c\).  Eq (1A) becomes \begin {align*} R & =p-e^{y}+c\\ & =y^{\prime }-e^{y}+c \end {align*}

Therefore, since \(\phi =c_{1}\) a constant, then the above becomes (by merging the constants)\[ y^{\prime }-e^{y}=c_{2}\] Which is the reduced ode to solve.