1.3.6.6 Example when G not zero \(y^{\prime }=\frac {1}{2}\left ( 1+\sqrt {5}\right ) x+\left ( \sqrt {5}+x\right ) y+y^{2}\)

Comparing to \(y^{\prime }=f_{0}+f_{1}y+f_{2}y^{2}\)

\begin{align*} f_{0} & =\frac {1}{2}\left ( 1+\sqrt {5}\right ) x\\ f_{1} & =\left ( \sqrt {5}+x\right ) \\ f_{2} & =1 \end{align*}

Since \(f_{1}=1\) already, we can calculate \(Q\) directly now

\begin{align*} Q & =f_{1}^{2}-4f_{0}-2f_{1}^{\prime }\\ & =\left ( \sqrt {5}+x\right ) ^{2}-4\left ( \frac {1}{2}\left ( 1+\sqrt {5}\right ) x\right ) -2\\ & =x^{2}-2x+3 \end{align*}

Since the degree is even, then now we expand \(\sqrt {Q}\) and keep rational integer part and call that \(X\)

\begin{align*} x^{2}-2x+3 & =\left ( a+bx\right ) ^{2}\\ & =a^{2}+b^{2}x^{2}+2abx \end{align*}

Comparing terms, then \(b=1\) and \(2ab=-2\). Hence \(a=-1\). Therefore

\begin{align*} \sqrt {Q} & =X\\ & =x-1 \end{align*}

Since \(X\) is not constant, then there are two possible particular polynomial solutions of \(y^{\prime }=f_{0}+f_{1}y+f_{2}y^{2}\). These are

\begin{align*} y & =-\frac {1}{2}\left ( f_{1}\pm X\right ) \\ & =-\frac {1}{2}\left ( \sqrt {5}+x\pm \left ( x-1\right ) \right ) \end{align*}

These are

\begin{align*} y_{1} & =-\frac {1}{2}\left ( \sqrt {5}+2x-1\right ) \\ y_{2} & =-\frac {1}{2}\left ( \sqrt {5}+1\right ) \end{align*}

Testing each shows that \(y_{1}\) satsifies the ode but not the second one. Hence we will use \(y_{1}\) particular solution in order now to find general solution to the given ode.

Using the direct formula given earlier then the solution is

\begin{align} y & =y_{1}+\Phi \frac {1}{c_{1}-\int \Phi f_{2}dx}\nonumber \\ \Phi & =e^{\int 2f_{2}y_{1}+f_{1}dx} \tag {2}\end{align}

Then

\begin{align*} \Phi & =e^{\int 2\left ( -\frac {1}{2}\left ( \sqrt {5}+2x-1\right ) \right ) +\left ( \sqrt {5}+x\right ) dx}\\ & =e^{x-\frac {1}{2}x^{2}}\end{align*}

Hence the solution is

\begin{align*} y & =y_{1}+\Phi \frac {1}{c_{1}-\int \Phi f_{2}dx}\\ & =-\frac {1}{2}\left ( \sqrt {5}+2x-1\right ) +\frac {e^{x-\frac {1}{2}x^{2}}}{c_{1}-\int e^{x-\frac {1}{2}x^{2}}dx}\\ & =-\frac {1}{2}\left ( \sqrt {5}+2x-1\right ) +\frac {e^{x-\frac {1}{2}x^{2}}}{c_{1}-\left ( \frac {\sqrt {\pi }e^{\frac {1}{2}}\sqrt {2}\operatorname {erf}\left ( \frac {\sqrt {2}}{2}x-\frac {\sqrt {2}}{2}\right ) }{2}\right ) }\end{align*}

Hence

\[ y=-\frac {1}{2}\left ( \sqrt {5}+2x-1\right ) +\frac {2e^{x-\frac {1}{2}x^{2}}}{c_{2}-\sqrt {\pi }e^{\frac {1}{2}}\sqrt {2}\operatorname {erf}\left ( \frac {\sqrt {2}}{2}x-\frac {\sqrt {2}}{2}\right ) }\]