4.1.2.3.2 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}}\]