1.3.3.2.3 Example \(xy^{\prime }=2x^{4}-18y+5y^{2}\) Comparing to

\[ xy^{\prime }=cx^{n}+ay-by^{2}\]

Shows that \(c=2,n=4,a=-18,b=-5\). Hence \(\frac {\left ( n-2a\right ) }{2n}=\frac {\left ( 4-2\left ( -18\right ) \right ) }{8}=\frac {40}{8}=5\). Therefore \(k=5\) which is positive integer.

The solution is finite continued fraction

\begin{align*} y & =\frac {a}{b}+\frac {x^{n}}{y_{1}}\\ y_{1} & =\frac {a+n}{c}+\frac {x^{n}}{y_{2}}\\ y_{2} & =\frac {a+2n}{b}+\frac {x^{n}}{y_{3}}\\ y_{3} & =\frac {a+3n}{c}+\frac {x^{n}}{y_{4}}\\ y_{4} & =\frac {a+4n}{b}+\frac {x^{n}}{y_{5}}\\ & \vdots \\ y_{k-1} & =\frac {a+\left ( k-1\right ) n}{\Delta }+\frac {x^{n}}{y_{k}}\end{align*}

Where \(\Delta =c\) when index \(i\) on \(y_{i}\) is odd and \(\Delta =b\) when index \(i\) on \(y_{i}\) is even.  In this example, we found that \(k=5\). Therefore we have (we stop at \(k-1=4\))

\begin{align} y & =\frac {a}{b}+\frac {x^{n}}{y_{1}}\nonumber \\ y_{1} & =\frac {a+n}{c}+\frac {x^{n}}{y_{2}}\nonumber \\ y_{2} & =\frac {a+2n}{b}+\frac {x^{n}}{y_{3}}\nonumber \\ y_{3} & =\frac {a+3n}{c}+\frac {x^{n}}{y_{4}}\nonumber \\ y_{4} & =\frac {a+4n}{b}+\frac {x^{n}}{y_{5}} \tag {1}\end{align}

Now, we just need to find \(y_{5}=y_{k}\) to finish. To find \(y_{5}\) we use either

\begin{equation} xy_{5}^{\prime }=bx^{n}+\left ( a+nk\right ) y_{5}-cy_{5}^{2} \tag {A}\end{equation}

Or

\begin{equation} xy_{5}^{\prime }=cx^{n}+\left ( a+nk\right ) y_{5}-by_{5}^{2} \tag {B}\end{equation}

ODE (A) is used when \(k\) is odd and ode (B) is used when \(k\) is even. Since \(k=5\) is odd, then we use (A). Hence the ode to solve for \(y_{5}\) is

\[ xy_{5}^{\prime }=bx^{n}+\left ( a+nk\right ) y_{5}-cy_{5}^{2}\]

But in this problem, \(c=2,n=4,a=-18,b=-5\), then the above becomes

\begin{align*} xy_{5}^{\prime } & =-5x^{4}+\left ( -18+20\right ) y_{5}-2y_{5}^{2}\\ & =-5x^{4}+2y_{5}-2y_{5}^{2}\end{align*}

Notice that this has form

\[ xy_{5}^{\prime }=Cx^{N}+Ay_{5}-By_{5}^{2}\]

(used upper case letters now, so not to confuse with lower case letters used for the original ode).

Now we see that \(N=4,A=2,C=-5,B=2\) which means \(N=2A\). But this is case (i). This always happens with case (ii) that we end up having to solve one ode using case (i) to finish. If we do not end up with case(i) ode, then we have made a mistake

But we know how to solve case (i) which we did above. This gives us \(y_{2}\). We plug this into (1) and now we have the solution for \(y\).

Now we solve (B) as we did in part (i). Let \(y_{2}=x^{A}u\). Then ode (B) becomes (as was shown in case (i) example)

\begin{equation} u^{\prime }=x^{A-1}\left ( C-Bu^{2}\right ) \tag {3}\end{equation}

We see that (3) is separable. Solving (3) gives

\[ u=\frac {1}{B}\tanh \left ( \frac {\sqrt {CB}\left ( C_{1}A+x^{A}\right ) }{A}\right ) \sqrt {CB}\]

But \(y_{5}=x^{A}u\), hence \(u=y_{5}x^{-A}\). Therefore

\begin{align*} y_{5}x^{-A} & =\frac {1}{B}\tanh \left ( \frac {\sqrt {CB}\left ( C_{1}A+x^{A}\right ) }{A}\right ) \sqrt {CB}\\ y_{5} & =\sqrt {CB}\frac {x^{A}}{B}\tanh \left ( \frac {\sqrt {CB}\left ( C_{1}A+x^{A}\right ) }{A}\right ) \end{align*}

Plugging in values for \(N=4,A=2,C=-5,B=2\) gives

\begin{align} y_{5} & =\sqrt {-10}\frac {x^{2}}{2}\tanh \left ( \frac {\sqrt {-10}\left ( 2C_{1}+x^{2}\right ) }{2}\right ) \nonumber \\ & =\frac {\sqrt {-10}}{2}x^{2}\tanh \left ( \frac {\sqrt {-10}x^{2}}{2}+C_{2}\right ) \nonumber \\ & =\frac {i\sqrt {10}}{2}x^{2}\tanh \left ( \frac {i\sqrt {10}x^{2}}{2}+C_{2}\right ) \tag {4}\end{align}

But \(\tanh \left ( iz\right ) =i\tan \left ( z\right ) \), hence the above becomes

\begin{align*} y_{5} & =\frac {i^{2}\sqrt {10}}{2}x^{2}\tan \left ( \frac {\sqrt {10}x^{2}}{2}+C_{2}\right ) \\ & =\frac {-\sqrt {10}}{2}x^{2}\tan \left ( \frac {\sqrt {10}x^{2}}{2}+C_{2}\right ) \end{align*}

Now we go back to (1) and find \(y\)

\begin{align} y & =\frac {a}{b}+\frac {x^{n}}{y_{1}}\nonumber \\ y_{1} & =\frac {a+n}{c}+\frac {x^{n}}{y_{2}}\nonumber \\ y_{2} & =\frac {a+2n}{b}+\frac {x^{n}}{y_{3}}\nonumber \\ y_{3} & =\frac {a+3n}{c}+\frac {x^{n}}{y_{4}}\nonumber \\ y_{4} & =\frac {a+4n}{b}+\frac {x^{n}}{y_{5}} \tag {1}\end{align}

Hence

\[ y=\frac {a}{b}+\frac {x^{n}}{\frac {a+n}{c}+\frac {x^{n}}{\frac {a+2n}{b}+\frac {x^{n}}{\frac {a+3n}{c}+\frac {x^{n}}{\frac {a+4n}{b}+\frac {x^{n}}{y_{5}}}}}}\]

Substituting all parameters into the above and using \(y_{2}\) from (4) gives, using \(c=2,n=4,a=-18,b=-5\)

\[ y=\frac {-18}{-5}+\frac {x^{4}}{\frac {-18+4}{2}+\frac {x^{4}}{\frac {-18+8}{-5}+\frac {x^{4}}{\frac {-18+12}{2}+\frac {x^{4}}{\frac {-18+16}{-5}+\frac {x^{4}}{\frac {-\sqrt {10}}{2}x^{2}\tan \left ( \frac {\sqrt {10}x^{2}}{2}+C_{2}\right ) }}}}}\]

Or

\[ y=\frac {18}{5}+\frac {x^{4}}{-7+\frac {x^{4}}{2+\frac {x^{4}}{-3+\frac {x^{4}}{\frac {2}{5}-\frac {2x^{2}}{\sqrt {10}\tan \left ( \frac {\sqrt {10}x^{2}}{2}+C_{2}\right ) }}}}}\]