### 4 Algorithm implementation based on modiﬁed Saunders and Smith algorithm

As with original Kovacic algorithm, an input ode \begin {align} y^{\prime \prime }\left ( x\right ) +ay^{\prime }\left ( x\right ) +by\left ( x\right ) & =0\tag {1}\\ a,b & \in \mathbb {C} \left ( x\right ) \nonumber \end {align}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz\qquad r\in \mathbb {C} \left ( x\right ) \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {equation} r=\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b \tag {4} \end {equation} It is Eq. (2) (called DE from now on) which is solved and not Eq. (1).  There are three steps for Saunders version. Case 1 and case 2 are handled in same way. In showing the steps, both Saunders  paper (2) and Carolyn J. Smith paper (3) were used. Smith paper is more detailed and has some corrections to Saunders algorithm also.

There are 4 steps to the algorithm. Step 0 determines which case $$r$$ belongs to (case 1 or 2 or 3 or non of these). Step 1 determines the ﬁxed $$e_{fixed},\theta _{fixed}$$ and also $$e_{i},\theta _{i}$$. Where $$i$$ can be 0 and higher depending. (see below). Step 2 uses the $$e_{fixed},$$ $$\theta _{fixed}\,$$ and all the $$e_{i},\theta _{i}$$ found in step 1 to determine the trial $$d,\Theta$$. Here $$\Theta$$ is used instead of $$\theta$$ as in Smith paper so not confuse it with the $$\theta _{i}$$ found in step 1.  If trial number $$d$$ can be found which is integer and positive then step 3 is now called. It is in step 3 where the minimal polynomial $$p\left ( x\right )$$ is found using the $$d$$ and $$\Theta$$. If such $$p\left ( x\right )$$ can be found then $$\omega$$ is solved for and the solution for the ode $$z^{\prime \prime }=rz$$ is now $$z=e^{\int \omega dx}$$. If no solution $$p\left ( x\right )$$ can be found, then the next trials $$d,\Theta$$ tried in order to ﬁnd $$p\left ( x\right )$$. This continues until all trials are tried or if solution is found. Below shows more details on each step. The trials $$d,\Theta$$ are found by iterating over all possible set of values called $$s$$. These sets of values are generated depending on case number and $$m$$ value, where $$m$$ is the number of terms in the square free factorization of $$t=t_{1}t_{2}^{2}t_{3}^{3}\cdots t_{m}^{m}$$. How this is all done is given below in examples.

##### 4.0.1 Step 0

This step is similar to Kovacic algorithm. In it we determine necessary conditions for each case but it is done is more direct way in this version. Given $$y^{\prime \prime }=ry$$, we write $$d=\frac {s}{t}$$ then now we do square free factorization on $$t$$ which gives$t=t_{1}t_{2}^{2}t_{3}^{3}\cdots t_{m}^{m}$ For example, if $$t=x^{2}$$, then $$t_{1}=1,t_{2}=x$$. And if $$t=3-x^{3}$$ then $$t_{1}=-1,t_{2}=x^{3}-3$$. And $$O\left ( \infty \right ) =\deg \left ( t\right ) -\deg \left ( s\right )$$. Then now we determine which case we are in by ﬁnding necessary conditions, This is done slightly diﬀerent from the original Kovacic. So at the end of this step we know if $$L=\left [ 1\right ]$$ (case 1) or $$L=\left [ 1,2\right ]$$ (case 1 and case 2), or $$L=\left [ 2\right ]$$ (case 2 only) or $$L=\left [ 4,6,12\right ]$$ (case 3 only) and so on.

The necessary conditions are based on the square free factorization on $$t=t_{1}t_{2}^{2}t_{3}^{3}\cdots t_{m}^{m}$$ and is summarized in Carolyn J. Smith paper (3) as (these are all the same necessary conditions as from original Kovacic paper) but expressed in terms of the square free factorization of $$t=t_{1}t_{2}^{2}\cdots t_{m}^{m}$$ where $$r=\frac {s}{t}$$.

1. $$L=\left [ 1\right ]$$ (meaning case 1) if $$t_{i}=1$$ for all odd $$i\geq 3$$ (i.e. no odd order poles allowed other than $$1$$) and $$O\left ( \infty \right )$$ is even only. (i.e. allowed $$O\left ( \infty \right )$$ are $$\cdots ,-6,-4,-2,0,2,4,6,\cdots$$.
2. $$L=\left [ 2\right ]$$ (meaning case 2) if $$t_{2}\neq 1$$ or $$t_{i}\neq 1$$ for any odd $$i\geq 3$$. (i.e. only pole of order 2 is allowed, and then poles of order $$3,5,7,\cdots$$ are allowed.
3. $$L=\left [ 4,6,12\right ]$$ (meaning case 3), if $$t_{i}=1$$ for all $$i>2$$ and $$O\left ( \infty \right ) \geq 2$$. (i.e. poles of order 1,2 is only allowed).

##### 4.0.2 Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \tag {5}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \tag {6} \end {align}

For an example, lets say that $$r=\frac {16x-3}{16x^{2}}$$. Hence $$t=16x^{2}=t_{1}t_{2}^{2}$$ where $$t_{1}=16,t_{2}=x$$. And $$O\left ( \infty \right ) =2-1=1$$. Therefore $$\deg \left ( t\right ) =2,\deg \left ( t_{1}\right ) =0$$ and $$t^{\prime }=\frac {d}{dx}16x^{2}=32x$$ and $$t_{1}^{\prime }=0$$. The above becomes\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 1,2\right ) -2-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 1-2\right ) \\ & =-\frac {1}{4}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {32x}{16x^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{2x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$. These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. Label these poles $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. For each $$c_{i}$$ then $$e_{i}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{\left ( x-c_{i}\right ) ^{2}}$$ in the partial fraction expansion of $$r$$ and $$\theta _{i}=\frac {e_{i}}{x-c_{i}}$$. For an example, if $$t=x^{2}$$. Then $$t=t_{1}t_{2}^{2}$$ and $$t_{1}=1,t_{2}=x$$. Hence the zeros of $$t_{2}$$ are $$c_{1}=0$$. There is only one zero. Hence $$k_{2}=1$$ and we only have one iteration to do. Hence $$b=1,e_{1}=\sqrt {1+4\left ( 1\right ) }=\sqrt {5}$$ and $$\theta _{e}=\frac {\sqrt {5}}{x-0}=\frac {\sqrt {5}}{x}$$.

Part (c)

This part applied only to case 1. It generates additional values of $$e_{i},\theta _{i}$$ in addition to what was generated in part (b). This is done for poles of $$r$$ of order $$4,6,8,\cdots ,M$$ if any exist. These are the roots of $$t_{4},t_{6},\cdots ,t_{M}$$. These poles are labeled $$c_{k_{2}+1},c_{k_{2}+2},\cdots ,c_{k}$$. The labeling starts from $$k_{2}$$ since for the pole of order 2 in part b we used $$c_{1},c_{2},\cdots ,c_{k_{2}}$$ for its zeros. Now we iterate for $$i$$ from $$k_{2}+1$$ to $$k$$. For each pole we ﬁnd its $$e_{i}$$ and $$\theta _{i}$$. These are found similar to original Kovacic paper. Examples below will illustrate better how this is done.

Note that if there are no poles of order $$4,6,\cdots$$ then $$k=k_{2}=M.$$ The value $$M$$ is used below to generate $$s$$ sequences in step 2. What this means is that for case 1, if there are no poles of order $$4,6,\cdots$$, then $$M$$ is just the number of poles of $$r$$ of order 2. For cases other than case 1, $$M$$ is always number of poles of $$r$$ of order 2. The checking on poles of order $$4,6,\cdots$$ is only done for case 1.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. This is the same as was done in original Kovacic algorithm. If $$O\left ( \infty \right )$$ is none of the above two cases, then case 1 is handled on its own and examples below show how this is done. Otherwise for all other cases $$e_{0}=0,e_{0}=0$$.

The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

##### 4.0.3 Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$. Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i} \tag {7} \end {equation} Where $$n$$ is the case number. For case 1, it will be $$n=1$$. For case 2 it will be $$n=2$$. For case 3 it will be $$4$$ and $$6$$ and $$12.$$ If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} What is $$s$$ in the above? These are sets of all combinations generated based on case number $$n$$ and $$m$$ values which will be described below. So the above trial $$d$$ and $$\Theta$$ are generated for each such set $$s$$. Each set $$s$$ has values $$\left \{ s_{0},s_{1},\cdots s_{m}\right \}$$ in it. So $$s_{i}$$ above means the $$i^{th}$$ element is the current set $$s$$. There will be $$\left ( n+1\right ) ^{m+1}$$ such diﬀerent $$s$$ sets. For example, case $$1$$, means $$n=1$$ and if $$m=2$$, which means $$t=t_{1}t_{2}^{2}$$ then there will be $$2^{3}=8$$ sets of $$s$$ to try. For each such set, we generate $$d,\Theta$$. If one set $$s$$ gives a $$d$$ which is an integer and positive, then $$\Theta$$ is generated and then step 3 is called to calculate $$\omega$$. If step 3 is successful then we stop since a solution is found. Hence step 3 takes as input the trial $$d$$ and $$\Theta$$ and is called repeatedly from step 2 until either solution $$y=e^{\int \omega dx}$$ is found or until all sets $$s$$ are used. This is done for each case number $$n$$ which can be $$1,2,4,6\,\$$or $$12$$. Starting from case 1 to case 3 (recall that case 3 has $$n=4,6,12\,\$$in it). Of course if any one case manages to ﬁnd a solution, then the algorithm stops.

Before going to step 3 description, We will show how the sets $$s$$ are generated. This depends on value of $$n$$ and $$M$$. Recall that $$M$$ is number of poles of $$r$$ of order 2 for case 1 if there are no higher order poles. For example, for $$n=1$$ and say $$M=2$$ then $$8$$ diﬀerent sets $$s$$ are generated. Based on all diﬀerent permutations of $$\left \{ \pm \frac {n}{2},\pm \frac {n}{2},\cdots ,\pm \frac {n}{2}\right \}$$. There are $$M+1$$ entries, because entries are indexed from $$0$$ to $$M$$. Hence for $$M=0$$ (which will happen if where are no poles), then there are $$\left ( n+1\right ) ^{1}$$ entries. For example for $$n=1$$ this means two entries given by $$\left \{ \pm \frac {1}{2}\right \}$$ which $$s=\left \{ \frac {1}{2}\right \}$$ and $$s=\left \{ -\frac {1}{2}\right \}$$ to try$\Lambda =\begin {array} [c]{c}-\frac {1}{2}\\ +\frac {1}{2}\end {array}$ For $$n=1,M=2$$ then there are $$\left ( 1+1\right ) ^{3}=8$$ entries. We have all combinations of $$\left \{ \pm \frac {1}{2},\pm \frac {1}{2},\pm \frac {1}{2}\right \}$$. This results in the following matrix$\Lambda =\begin {bmatrix} -\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & -\frac {1}{2} & +\frac {1}{2}\\ -\frac {1}{2} & +\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & \frac {1}{2} & +\frac {1}{2}\\ +\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ +\frac {1}{2} & -\frac {1}{2} & +\frac {1}{2}\\ +\frac {1}{2} & +\frac {1}{2} & -\frac {1}{2}\\ +\frac {1}{2} & +\frac {1}{2} & +\frac {1}{2}\end {bmatrix}$ But if $$n=1$$ and $$M=1$$ then there are $$\left ( 1+1\right ) ^{2}=4$$ entries. All combinations of$$\left \{ \pm \frac {1}{2},\pm \frac {1}{2}\right \}$$ and the matrix is$\Lambda =\begin {bmatrix} -\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & +\frac {1}{2}\\ +\frac {1}{2} & -\frac {1}{2}\\ +\frac {1}{2} & +\frac {1}{2}\end {bmatrix}$ Each row in the above matrix $$S$$ is one set $$s$$ to try. To be more clear, in the equation $$\Theta =\left ( n\right ) \left ( e_{fix}\right ) +\sum _{i=0}^{M}s_{i}e_{i}$$ the $$s_{i}$$ in the equation means the $$i^{th}$$ entry in that speciﬁc $$s$$ set we are using at the moment, which happens to be one row of the matrix $$\Lambda$$. For example, if we are trying the second row in $$\Lambda$$, then $$s_{0}=-\frac {1}{2},s_{1}=-\frac {1}{2},s_{2}=+\frac {1}{2}$$. For the case $$n=1$$ and $$M=3$$, then $$\left \{ \pm \frac {1}{2},\pm \frac {1}{2},\pm \frac {1}{2},\pm \frac {1}{2}\right \}$$. There is $$\left ( 2\right ) ^{4}=16$$ diﬀerent sets $$s~$$ (or 16 rows in the matrix $$\Lambda$$). The matrix $$\Lambda$$ is$\Lambda =\begin {bmatrix} -\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2} & \frac {1}{2}\\ -\frac {1}{2} & -\frac {1}{2} & \frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & -\frac {1}{2} & \frac {1}{2} & \frac {1}{2}\\ -\frac {1}{2} & \frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & \frac {1}{2} & -\frac {1}{2} & \frac {1}{2}\\ -\frac {1}{2} & \frac {1}{2} & \frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & \frac {1}{2} & \frac {1}{2} & \frac {1}{2}\\ \frac {1}{2} & -\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ \frac {1}{2} & -\frac {1}{2} & -\frac {1}{2} & \frac {1}{2}\\ \frac {1}{2} & -\frac {1}{2} & \frac {1}{2} & -\frac {1}{2}\\ \frac {1}{2} & -\frac {1}{2} & \frac {1}{2} & \frac {1}{2}\\ \frac {1}{2} & \frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ \frac {1}{2} & \frac {1}{2} & -\frac {1}{2} & \frac {1}{2}\\ \frac {1}{2} & \frac {1}{2} & \frac {1}{2} & -\frac {1}{2}\\ \frac {1}{2} & \frac {1}{2} & \frac {1}{2} & \frac {1}{2}\end {bmatrix}$ If it was case 2 which means $$n=2$$, then if $$M=2$$, then we have all diﬀerent permutations of $$\,1,-1,0$$  in each entry. This gives $$3^{3}=27$$ diﬀerent sets to try$\Lambda =\begin {bmatrix} -1 & -1 & -1\\ -1 & -1 & 0\\ -1 & -1 & +1\\ -1 & 0 & -1\\ -1 & 0 & 0\\ -1 & 0 & +1\\ \vdots & \vdots & \vdots \\ +1 & +1 & +1 \end {bmatrix}$ And if $$n=2,M=3$$ then this gives $$3^{4}=81$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -1 & -1 & -1 & -1\\ -1 & -1 & -1 & 0\\ -1 & -1 & -1 & +1\\ -1 & -1 & 0 & -1\\ -1 & -1 & 0 & 0\\ -1 & -1 & 0 & +1\\ \vdots & \vdots & \vdots & \vdots \\ +1 & +1 & +1 & +1 \end {bmatrix}$ And if $$n=4,M=2$$ then this gives $$5^{3}=125$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -2 & -2 & -2\\ -2 & -2 & -2\\ -2 & -2 & -2\\ -2 & -2 & -2\\ -2 & -2 & -2\\ \vdots & \vdots & \vdots \\ +2 & +2 & +2 \end {bmatrix}$ And if $$n=4,M=3$$ then this gives $$5^{4}=625$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -2 & -2 & -2 & -2\\ -2 & -2 & -2 & -1\\ -2 & -2 & -2 & 0\\ -2 & -2 & -2 & +1\\ -2 & -2 & -2 & +2\\ \vdots & \vdots & \vdots & \vdots \\ +2 & +2 & +2 & +2 \end {bmatrix}$ And if $$n=6,M=2$$ then this gives $$7^{3}=343$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -3 & -3 & -3\\ -2 & -2 & -2\\ -2 & -2 & -1\\ -2 & -2 & -0\\ -2 & -2 & +1\\ -2 & -2 & +2\\ -2 & -2 & +3\\ \vdots & \vdots & \vdots \\ +3 & +3 & +3 \end {bmatrix}$ And if $$n=6,M=3$$ then this gives $$7^{4}=2401$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -3 & -3 & -3 & -3\\ -3 & -3 & -3 & -2\\ -3 & -3 & -3 & -1\\ -3 & -3 & -3 & 0\\ -3 & -3 & -3 & +1\\ -3 & -3 & -3 & +2\\ -3 & -3 & -3 & +3\\ \vdots & \vdots & \vdots & \vdots \\ +3 & +3 & +3 & +3 \end {bmatrix}$ And if $$n=12,M=2$$ then this gives $$13^{3}=2197$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -12 & -12 & -12\\ -12 & -12 & -11\\ -12 & -12 & -10\\ \vdots & \vdots & \vdots \\ -12 & -12 & +12\\ \vdots & \vdots & \vdots \\ +12 & +12 & +12 \end {bmatrix}$ And if $$n=12,M=3$$ then this gives $$13^{4}=28561$$ diﬀerent sets $$s$$$\Lambda =\begin {bmatrix} -12 & -12 & -12 & -12\\ -12 & -12 & -12 & -11\\ -12 & -12 & -12 & -10\\ \vdots & \vdots & \vdots & \vdots \\ -12 & -12 & -12 & +12\\ \vdots & \vdots & \vdots & \vdots \\ +12 & +12 & +12 & +12 \end {bmatrix}$ And so on.

##### 4.0.4 step 3

The input to this step is the integer $$d$$ and $$\Theta$$ found from Eq (7,8) as described in step 2 and also $$r$$ which comes from $$z^{\prime \prime }=rz$$.

This step is broken into these parts. First we ﬁnd the $$p_{-1}\left ( x\right )$$ polynomial. If we are to solve for its coeﬃcients, then next we build the minimal polynomial from the $$p_{i}\left ( x\right )$$ polynomials constructed during ﬁnding $$p_{-1}\left ( x\right )$$. The minimal polynomial $$p_{\min }\left ( x\right )$$ will be a function of $$\omega$$. Next we solve for $$\omega$$ from $$p_{\min }\left ( x\right ) =0$$. If this is successful, then we have found $$\omega$$ and the ﬁrst solution to the ode $$z^{\prime \prime }=rz$$ is $$e^{\int \omega dx}\,$$. Below shows how this is done.

We start by forming a polynomial$p\left ( x\right ) =x^{d}+a_{d-1}x^{d-1}+\cdots +a_{0}$ Notice that $$x^{d}$$ has coeﬃcient $$1$$. The goal is to solve for the $$a_{i}$$ coeﬃcient. Now depending on case  number $$n$$, we do the following. If case $$n=1$$ then\begin {align} p_{1} & =-p\tag {9}\\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}\nonumber \\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 1\right ) \left ( 1\right ) rp_{1}\nonumber \end {align}

And it is $$p_{-1}=0$$ which is solved for the coeﬃcients $$a_{i}$$. For the case $$n=2$$ we ﬁnd $$p$$ as follows\begin {align} p_{2} & =-p\tag {10}\\ p_{1} & =-p_{2}^{\prime }-\Theta p_{2}\nonumber \\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}-\left ( 1\right ) \left ( 2\right ) rp_{2}\nonumber \\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 2\right ) \left ( 1\right ) rp_{1}\nonumber \end {align}

And it is $$p_{-1}=0$$ which is solved for the coeﬃcients $$a_{i}$$. For the case $$n=4$$ we ﬁnd $$p$$ as follows\begin {align} p_{4} & =-p\tag {11}\\ p_{3} & =-p_{4}^{\prime }-\Theta p_{4}\nonumber \\ p_{2} & =-p_{3}^{\prime }-\Theta p_{3}-\left ( 1\right ) \left ( 4\right ) rp_{4}\nonumber \\ p_{1} & =-p_{2}^{\prime }-\Theta p_{2}-\left ( 2\right ) \left ( 3\right ) rp_{3}\nonumber \\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}-\left ( 3\right ) \left ( 2\right ) rp_{2}\nonumber \\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 4\right ) \left ( 1\right ) rp_{1}\nonumber \end {align}

And it is $$p_{-1}=0$$ which is solved for the coeﬃcients $$a_{i}$$. For the case $$n=6$$ we ﬁnd $$p$$ as follows\begin {align} p_{6} & =-p\tag {12}\\ p_{5} & =-p_{6}^{\prime }-\Theta p_{6}\nonumber \\ p_{4} & =-p_{5}^{\prime }-\Theta p_{5}-\left ( 1\right ) \left ( 6\right ) rp_{6}\nonumber \\ p_{3} & =-p_{4}^{\prime }-\Theta p_{4}-\left ( 2\right ) \left ( 5\right ) rp_{5}\nonumber \\ p_{2} & =-p_{3}^{\prime }-\Theta p_{3}-\left ( 3\right ) \left ( 4\right ) rp_{4}\nonumber \\ p_{1} & =-p_{2}^{\prime }-\Theta p_{2}-\left ( 4\right ) \left ( 3\right ) rp_{3}\nonumber \\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}-\left ( 5\right ) \left ( 2\right ) rp_{2}\nonumber \\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 6\right ) \left ( 1\right ) rp_{1}\nonumber \end {align}

And it is $$p_{-1}=0$$ which is solved for the coeﬃcients $$a_{i}$$. For the case $$n=12$$ we ﬁnd $$p$$ as follows\begin {align} p_{12} & =-p\tag {13}\\ p_{11} & =-p_{12}^{\prime }-\Theta p_{12}\nonumber \\ p_{10} & =-p_{11}^{\prime }-\Theta p_{11}-\left ( 1\right ) \left ( 12\right ) rp_{12}\nonumber \\ p_{9} & =-p_{10}^{\prime }-\Theta p_{10}-\left ( 2\right ) \left ( 11\right ) rp_{11}\nonumber \\ p_{8} & =-p_{9}^{\prime }-\Theta p_{9}-\left ( 3\right ) \left ( 10\right ) rp_{10}\nonumber \\ p_{7} & =-p_{8}^{\prime }-\Theta p_{8}-\left ( 4\right ) \left ( 9\right ) rp_{9}\nonumber \\ p_{6} & =-p_{7}^{\prime }-\Theta p_{7}-\left ( 5\right ) \left ( 8\right ) rp_{8}\nonumber \\ p_{5} & =-p_{6}^{\prime }-\Theta p_{6}-\left ( 6\right ) \left ( 7\right ) rp_{7}\nonumber \\ p_{4} & =-p_{5}^{\prime }-\Theta p_{5}-\left ( 7\right ) \left ( 6\right ) rp_{6}\nonumber \\ p_{3} & =-p_{4}^{\prime }-\Theta p_{4}-\left ( 8\right ) \left ( 5\right ) rp_{5}\nonumber \\ p_{2} & =-p_{3}^{\prime }-\Theta p_{3}-\left ( 9\right ) \left ( 4\right ) rp_{4}\nonumber \\ p_{1} & =-p_{2}^{\prime }-\Theta p_{2}-\left ( 10\right ) \left ( 3\right ) rp_{3}\nonumber \\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}-\left ( 11\right ) \left ( 2\right ) rp_{2}\nonumber \\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 12\right ) \left ( 1\right ) rp_{1}\nonumber \end {align}

If we are able to solve for all the $$a_{i}$$ by solving $p_{-1}\left ( x\right ) =0$ Then we now have determined $$p\left ( x\right )$$. This is used to ﬁnd $$\omega$$ as follows. For the case $$n=1$$ $\omega =\frac {p^{\prime }}{p}+\Theta$ For the case $$n=2$$  $$\omega$$ is found by solving $\omega ^{2}-\phi \omega +\frac {\phi ^{\prime }}{2}+\frac {\phi ^{2}}{2}-r=0$ Where $$\phi =\frac {p^{\prime }}{p}+\Theta$$.

Where $$p_{0},p_{1},p_{2}$$ are from Eq (10) above. For the case $$n=4$$ then$p_{\min }=\frac {1}{4!}p_{0}+\frac {1}{3!}p_{1}\omega +\frac {1}{2!}p_{2}\omega ^{2}+p_{3}\omega ^{3}+p_{4}\omega ^{4}$ Where $$p_{0},p_{1},p_{2},p_{3},p_{4}$$ are from Eq (11) above. For the case $$n=6$$ then$p_{\min }=\frac {1}{6!}p_{0}+\frac {1}{5!}p_{1}\omega +\frac {1}{4!}p_{2}\omega ^{2}+\frac {1}{3!}p_{3}\omega ^{3}+\frac {1}{2!}p_{4}\omega ^{4}+p_{5}\omega ^{5}+p_{6}\omega ^{6}$ Where $$p_{0},p_{1},p_{2},p_{3},p_{4},p_{5},p_{6}$$ are from Eq (12) above. For the case $$n=12$$ then

$p_{\min }=\frac {1}{12!}p_{0}+\frac {1}{11!}p_{1}\omega +\frac {1}{10!}p_{2}\omega ^{2}+\frac {1}{9!}p_{3}\omega ^{3}+\frac {1}{8!}p_{4}\omega ^{4}+\frac {1}{7!}p_{5}\omega ^{5}+\frac {1}{6!}p_{6}\omega ^{6}+\frac {1}{5!}p_{7}\omega ^{7}+\frac {1}{4!}p_{8}\omega ^{8}+\frac {1}{3!}p_{9}\omega ^{9}+\frac {1}{2!}p_{10}\omega ^{10}+p_{11}\omega ^{11}+p_{12}\omega ^{12}$

Where $$p_{i}$$ for $$i=0\cdots 12$$ are from Eq (13) above.  In each case, we now solve for $p_{\min }\left ( x\right ) =0$ For $$\omega$$. If this is successful, then now we have to verify the solution satisﬁes the Riccati ODE. $$\omega$$ must satisfy in all case the following equation$\omega ^{\prime }+\omega ^{2}=r$ If it does, then we have solved the $$z^{\prime \prime }=rz$$ ode $$z=e^{\int \omega dx}$$ and also the original $$y^{\prime \prime }+ay^{\prime }+by=0$$ ode. This completes the Kovacic algorithm. Examples are given below showing how to implement the above to solve number of ode’s.

#### 4.1 Worked examples

4.1.1 Example 1 case one
4.1.2 Example 2 case one
4.1.3 Example 3 case one
4.1.4 Example 4 case one
4.1.5 Example 5 case one
4.1.6 Example 6 case one
4.1.7 Example 7 case two
4.1.8 Example 8 case two
4.1.9 Example 9 case two
4.1.10 Example 10 case two
4.1.11 Example 11 case one
4.1.12 Example 12 case one
4.1.13 Example 13 case one

##### 4.1.1 Example 1 case one

Solve $\left ( 1-x^{2}\right ) y^{\prime \prime }-2xy^{\prime }+6y=0$ Normalizing so that coeﬃcient of $$u^{\prime \prime }$$ is one gives (assuming $$x\neq 1$$)\begin {align} y^{\prime \prime }-2\frac {x}{\left ( 1-x^{2}\right ) }y^{\prime }+\frac {6}{\left ( 1-x^{2}\right ) }y & =0\nonumber \\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0 \tag {1} \end {align}

Hence \begin {align*} a & =\frac {-2x}{\left ( 1-x^{2}\right ) }\\ b & =\frac {6}{\left ( 1-x^{2}\right ) } \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( \frac {-2x}{\left ( 1-x^{2}\right ) }\right ) ^{2}+\frac {1}{2}\frac {d}{dx}\left ( \frac {-2x}{\left ( 1-x^{2}\right ) }\right ) -\frac {6}{\left ( 1-x^{2}\right ) }\nonumber \\ & =\frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$. The free square factorization of $$t$$ is $$t=t_{1}t_{2}^{2}$$. Hence \begin {equation} m=2 \tag {6} \end {equation} And $$t_{1}=1,t_{2}=\left ( x^{2}-1\right )$$. Now $$O\left ( \infty \right ) =\deg \left ( t\right ) -\deg \left ( s\right ) =4-2=2$$. The poles of $$r$$ are $$x=1,-1$$ each of order $$2$$.  Looking at the cases table giving up, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that all cases are possible. Hence $$L=\left \{ 1,2,4,6,12\right \}$$. So $$n=1,n=2,n=4,n=6,n=12$$ will be tried until one is successful.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =2,t=\left ( x^{2}-1\right ) ^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 2,2\right ) -4-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 2-4\right ) \\ & =-\frac {1}{2}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( \left ( x^{2}-1\right ) ^{2}\right ) }{\left ( x^{2}-1\right ) ^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {x}{x^{2}-1} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$. These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. From above we found that $$t_{2}=x^{2}-1$$. Label these poles $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. The zeros of $$t_{2}$$ are $$\left \{ 1,-1\right \}$$ therefore $$c_{1}=1,c_{2}=-1$$ and $$k_{2}=2$$. For each $$c_{i}$$ then $$e_{i}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{\left ( x-c_{i}\right ) ^{2}}$$ in the partial fraction expansion of $$r$$ which is\begin {align*} \frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}} & =\left ( \sum _{i}\frac {\alpha _{i}}{\left ( x-c_{i}\right ) ^{2}}\right ) +\left ( \sum _{j}\frac {\beta _{j}}{x-d_{j}}\right ) \\ & =\left ( -\frac {1}{4}\frac {1}{\left ( x-1\right ) ^{2}}-\frac {1}{4}\frac {1}{\left ( x+1\right ) ^{2}}\right ) +\left ( \frac {13}{4}\frac {1}{\left ( x-1\right ) }-\frac {13}{4}\frac {1}{x+1}\right ) \end {align*}

Therefore for $$c_{1}=1$$, looking at the above, we see that the coeﬃcient of $$\frac {1}{\left ( x-1\right ) ^{2}}$$ is $$\frac {-1}{4}$$. Hence $$b=\frac {-1}{4}$$ and $$e_{1}=\sqrt {1+4b}=\sqrt {1-4\frac {1}{4}}=0$$. For $$c_{2}=-1\$$looking at the above, we see that the coeﬃcient of $$\frac {1}{\left ( x+1\right ) ^{2}}$$ is $$\frac {-1}{4}$$. Hence $$b=\frac {-1}{4}$$ and $$e_{2}=\sqrt {1+4b}=\sqrt {1-4\frac {1}{4}}=0$$. Therefore\begin {align*} e_{1} & =0\\ e_{2} & =0 \end {align*}

Now, $$\theta _{i}=\frac {e_{i}}{x-c_{i}}$$. For $$c_{1}=1$$ this gives $$\theta _{1}=\frac {e_{1}}{x-1}=0$$ since $$e_{1}=0$$. And $$\theta _{2}=\frac {e_{2}}{x-c_{2}}$$. For $$c_{2}=-1$$ this gives $$\theta _{2}=\frac {e_{2}}{x+1}=0$$ since $$e_{2}=0$$. Hence\begin {align*} \theta _{1} & =0\\ \theta _{2} & =0 \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Since non exist here. This is skipped. This means $M=2$ since $$2$$ is the number of poles of order 2.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since in this example $$O\left ( \infty \right ) =2$$ then \begin {align*} e_{0} & =\sqrt {1+4b}\\ \theta _{0} & =0 \end {align*}

Now we need to ﬁnd $$b$$. The Laurent series expansion of $$r$$ at $$\infty$$ is $$\frac {6}{x^{2}}+\frac {5}{x^{4}}+\frac {4}{x^{6}}+\cdots$$. Hence $$b=6$$. Therefore\begin {align*} e_{0} & =\sqrt {1+4\left ( 6\right ) }\\ & =\sqrt {25}\\ & =5 \end {align*}

Now we have found all $$e_{i},\theta _{i}$$. They are\begin {align*} e & =\left \{ 5,0,0\right \} \\ \theta & =\left \{ 0,0,0\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$. Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i} \tag {7} \end {equation} Where $$n$$ is the case number. For case 1, it will be $$n=1$$. For case 2 it will be $$n=2$$. For case 3 it will be $$4$$ and $$6$$ and $$12.$$ If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} We need to ﬁrst generate $$s$$ sets. For $$n=1$$ and since $$M=2$$ in this example (number of poles of order 2), then these these are given by$\Lambda =\begin {bmatrix} -\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & -\frac {1}{2} & +\frac {1}{2}\\ -\frac {1}{2} & +\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & +\frac {1}{2} & +\frac {1}{2}\\ +\frac {1}{2} & -\frac {1}{2} & -\frac {1}{2}\\ +\frac {1}{2} & -\frac {1}{2} & +\frac {1}{2}\\ +\frac {1}{2} & +\frac {1}{2} & -\frac {1}{2}\\ +\frac {1}{2} & +\frac {1}{2} & +\frac {1}{2}\end {bmatrix}$ We go over each row one at a time. Trying the ﬁrst row $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$$ which means $$s_{0}=\frac {-1}{2},s_{1}=\frac {-1}{2},s_{2}=-\frac {1}{2}$$. Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{2},\theta _{fixed}=\frac {x}{x^{2}-1}$$ then\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( s_{1}e_{1}+s_{2}e_{2}\right ) \\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( \frac {-1}{2}\left ( 0\right ) -\frac {1}{2}\left ( 0\right ) \right ) \\ & =-3 \end {align*}

Since this is negative, then we skip this set $$s$$. Now we try the second row of $$\Lambda$$ which is $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {+1}{2}\right \}$$. Then above now gives\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( s_{1}e_{1}+s_{2}e_{2}\right ) \\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( \frac {-1}{2}\left ( 0\right ) +\frac {1}{2}\left ( 0\right ) \right ) \\ & =-3 \end {align*}

Since this is negative, then we skip this set $$s$$. Now we try the third row of $$\Lambda$$ which is $$s=\left \{ \frac {-1}{2},\frac {+1}{2},\frac {-1}{2}\right \}$$. Then above now gives\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( s_{1}e_{1}+s_{2}e_{2}\right ) \\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( \frac {+1}{2}\left ( 0\right ) -\frac {1}{2}\left ( 0\right ) \right ) \\ & =-3 \end {align*}

Since this is negative, then we skip this set $$s$$. Now we try the row 4 of $$\Lambda$$ which is $$s=\left \{ \frac {-1}{2},\frac {+1}{2},\frac {+1}{2}\right \}$$. Then above now gives\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( s_{1}e_{1}+s_{2}e_{2}\right ) \\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 5\right ) -\left ( \frac {+1}{2}\left ( 0\right ) +\frac {1}{2}\left ( 0\right ) \right ) \\ & =-3 \end {align*}

Since this is negative, then we skip this set $$s$$. Now we try the row 5 of $$\Lambda$$ which is $$s=\left \{ \frac {+1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$$. Then above now gives\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {+1}{2}\right ) \left ( 5\right ) -\left ( s_{1}e_{1}+s_{2}e_{2}\right ) \\ & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {+1}{2}\right ) \left ( 5\right ) -\left ( \frac {+1}{2}\left ( 0\right ) +\frac {1}{2}\left ( 0\right ) \right ) \\ & =+2 \end {align*}

Since $$d\geq 0$$, then we can use it. Now  using Eq (8) gives\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i}\\ & =\left ( 1\right ) \left ( \frac {x}{x^{2}-1}\right ) +\left ( s_{0}\theta _{0}+s_{1}\theta _{1}+s_{2}\theta _{2}\right ) \\ & =\frac {x}{x^{2}-1}+\left ( \frac {+1}{2}\theta _{0}-\frac {1}{2}\theta _{1}-\frac {1}{2}\theta _{2}\right ) \end {align*}

But all $$\theta _{i}=0$$. Therefore $\Theta =\frac {x}{x^{2}-1}$ Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$\omega$$ if possible.

Step 3

The input to this step is the integer $$d=2$$ and $$\Theta =\frac {x}{x^{2}-1}$$ found from step 2 and also $$r=\frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}}$$ which comes from $$z^{\prime \prime }=rz$$. This step is broken into these parts. First we ﬁnd the $$p_{-1}\left ( x\right )$$ polynomial. If we are to solve for its coeﬃcients, then next we build the minimal polynomial from the $$p_{i}\left ( x\right )$$ polynomials constructed during ﬁnding $$p_{-1}\left ( x\right )$$. The minimal polynomial $$p_{\min }\left ( x\right )$$ will be a function of $$\omega$$. Next we solve for $$\omega$$ from $$p_{\min }\left ( x\right ) =0$$. If this is successful, then we have found $$\omega$$ and the ﬁrst solution to the ode $$z^{\prime \prime }=rz$$ is $$z=e^{\int \omega dx}\,$$. Below shows how this is done.

We start by forming a polynomial\begin {align*} p\left ( x\right ) & =x^{d}+a_{d-1}x^{d-1}+\cdots +a_{0}\\ & =x^{2}+a_{1}x+a_{0} \end {align*}

The goal is to solve for the $$a_{i}$$ coeﬃcient. Now depending on case  number $$n$$, we do the following. Since we are in case $$n=1$$ then\begin {align*} p_{1} & =-p\\ & =-x^{2}-a_{1}x-a_{0}\\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}\\ & =-\left ( -x^{2}-a_{1}x-a_{0}\right ) ^{\prime }-\left ( \frac {x}{x^{2}-1}\right ) \left ( -x^{2}-a_{1}x-a_{0}\right ) \\ & =\frac {\left ( xa_{0}-a_{1}-2x+2x^{2}a_{1}+3x^{3}\right ) }{x^{2}-1}\\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 1\right ) \left ( 1\right ) rp_{1}\\ & =-\left ( \frac {\left ( xa_{0}-a_{1}-2x+2x^{2}a_{1}+3x^{3}\right ) }{x^{2}-1}\right ) ^{\prime }-\left ( \frac {x}{x^{2}-1}\right ) \left ( \frac {\left ( xa_{0}-a_{1}-2x+2x^{2}a_{1}+3x^{3}\right ) }{x^{2}-1}\right ) -\frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}}\left ( -x^{2}-a_{1}x-a_{0}\right ) \\ & =2\frac {\left ( 2xa_{1}+3a_{0}+1\right ) }{x^{2}-1} \end {align*}

Now we try to solve for $$a_{i}$$ using $$p_{-1}\left ( x\right ) =0$$. This gives $$2xa_{1}+3a_{0}+1=0$$ which gives $$a_{1}=0,a_{0}=-\frac {1}{3}$$.  Hence this implies\begin {align*} p\left ( x\right ) & =x^{2}+a_{1}x+a_{0}\\ & =x^{2}-\frac {1}{3} \end {align*}

Since this is case $$n=1$$ then\begin {align*} \omega & =\frac {p^{\prime }}{p}+\Theta \\ & =\frac {2x}{x^{2}-\frac {1}{3}}+\frac {x}{x^{2}-1}\\ & =x\frac {9x^{2}-7}{3x^{4}-4x^{2}+1} \end {align*}

Before using this, we will verify it is correct. For case 1 the above should satisfy$\omega ^{\prime }+\omega ^{2}=r$ Let us see if this is the case or not.\begin {align*} \frac {d}{dx}\left ( x\frac {9x^{2}-7}{3x^{4}-4x^{2}+1}\right ) +\left ( x\frac {9x^{2}-7}{3x^{4}-4x^{2}+1}\right ) ^{2} & =\frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}}\\ \frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}} & =\frac {6x^{2}-7}{\left ( x^{2}-1\right ) ^{2}} \end {align*}

Veriﬁed. Since solution $$\omega$$ is found and veriﬁed, then ﬁrst solution to the ode is \begin {align*} z & =e^{\int \omega dx}\\ & =e^{\int \frac {x\left ( 9x^{2}-7\right ) }{3x^{4}-4x^{2}+1}dx}\\ & =e^{\frac {1}{2}\ln \left ( x^{2}-1\right ) +\ln \left ( x^{2}-\frac {1}{3}\right ) }\\ & =\sqrt {x^{2}-1}\left ( x^{2}-\frac {1}{3}\right ) \end {align*}

Hence ﬁrst solution to the original ode is\begin {align*} y & =ze^{\frac {-1}{2}\int adx}\\ & =\sqrt {x^{2}-1}\left ( x^{2}-\frac {1}{3}\right ) e^{\frac {-1}{2}\int \frac {-2x}{\left ( 1-x^{2}\right ) }dx}\\ & =\sqrt {x^{2}-1}\left ( x^{2}-\frac {1}{3}\right ) e^{\int \frac {x}{\left ( 1-x^{2}\right ) }dx}\\ & =\sqrt {x^{2}-1}\left ( x^{2}-\frac {1}{3}\right ) e^{\frac {-1}{2}\ln \left ( x^{2}-1\right ) }\\ & =\frac {\sqrt {x^{2}-1}\left ( x^{2}-\frac {1}{3}\right ) }{\sqrt {x^{2}-1}}\\ & =\left ( x^{2}-\frac {1}{3}\right ) \end {align*}

##### 4.1.2 Example 2 case one

Solve $x\left ( x-1\right ) ^{2}y^{\prime \prime }-2y=0$ Normalizing so that coeﬃcient of $$u^{\prime \prime }$$ is one gives (assuming $$x\neq 1$$ and $$x\neq 0$$)\begin {align} y^{\prime \prime }-\frac {2}{x\left ( x-1\right ) ^{2}}y & =0\nonumber \\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0 \tag {1} \end {align}

Hence \begin {align*} a & =0\\ b & =-\frac {2}{x\left ( x-1\right ) ^{2}} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {2}{x\left ( x-1\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {2}{x\left ( x-1\right ) ^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$. The free square factorization of $$t$$ is $$t=t_{1}t_{2}^{2}$$. Hence \begin {equation} m=2 \tag {6} \end {equation} And\begin {align*} t_{1} & =x\\ t_{2} & =x-1 \end {align*}

Now $$O\left ( \infty \right ) =\deg \left ( t\right ) -\deg \left ( s\right ) =3-0=3$$. The poles of $$r$$ are $$x=0$$ of order 1 and $$x=1$$ of order 2.  Looking at the cases table giving up, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that all cases are possible. Hence $$L=\left \{ 1,2,4,6,12\right \}$$. So $$n=1,n=2,n=4,n=6,n=12$$ will be tried until one is successful. Starting with $$n=1$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =3,t=x\left ( x-1\right ) ^{2},t_{1}=x$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 3,2\right ) -3-3\left ( 1\right ) \right ) \\ & =\frac {1}{4}\left ( 2-3-3\right ) \\ & =-1\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( x\left ( x-1\right ) ^{2}\right ) }{x\left ( x-1\right ) ^{2}}+3\left ( \frac {x^{\prime }}{x}\right ) \right ) \\ & =\frac {1}{4}\left ( \frac {3x^{2}-4x+1}{x\left ( x-1\right ) ^{2}}+\frac {3}{x}\right ) \\ & =\frac {1}{2x}\frac {3x-2}{x-1} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$. These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. From above we found that $$t_{2}=x-1$$. Label these poles $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. The zeros of $$t_{2}$$ are $$\left \{ 1\right \}$$ therefore $$c_{1}=1$$ and $$k_{2}=1$$ since one zero. Hence $M=1$ For each $$c_{i}$$ then $$e_{i}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{\left ( x-c_{i}\right ) ^{2}}$$ in the partial fraction expansion of $$r$$ which is\begin {align*} r & =\frac {2}{x\left ( x-1\right ) ^{2}}\\ & =\left ( \sum _{i}\frac {\alpha _{i}}{\left ( x-c_{i}\right ) ^{2}}\right ) +\left ( \sum _{j}\frac {\beta _{j}}{x-d_{j}}\right ) \\ & =\left ( \frac {2}{\left ( x-1\right ) ^{2}}\right ) +\left ( -\frac {2}{x-1}+\frac {2}{x}\right ) \end {align*}

Therefore for $$c_{1}=1$$, looking at the above, we see that the coeﬃcient of $$\frac {1}{\left ( x-1\right ) ^{2}}$$ is $$2$$. Hence $$b=2$$ and $$e_{1}=\sqrt {1+4b}=\sqrt {1+8}=3$$. Hence$e_{1}=3$ Now, $$\theta _{i}=\frac {e_{i}}{x-c_{i}}$$. For $$c_{1}=1$$ this gives $$\theta _{1}=\frac {e_{1}}{x-1}=\frac {3}{x-1}$$. Hence$\theta _{1}=\frac {3}{x-1}$ Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Since non exist here. This is skipped. Hence $$M$$ stays $$1$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since in this example $$O\left ( \infty \right ) =3$$ then \begin {align*} e_{0} & =1\\ \theta _{0} & =0 \end {align*}

Now we have found all $$e_{i},\theta _{i}$$. They are\begin {align*} e & =\left \{ 1,3\right \} \\ \theta & =\left \{ 0,\frac {3}{x-1}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$. Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i} \tag {7} \end {equation} Where $$n$$ is the case number. For case 1, it will be $$n=1$$. For case 2 it will be $$n=2$$. For case 3 it will be $$4$$ and $$6$$ and $$12.$$ If $$d\geq 0$$, then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} We need to ﬁrst generate $$s$$ sets. For $$n=1$$ and since $$M=1$$ in this example, then these these are given by$\Lambda =\begin {bmatrix} -\frac {1}{2} & -\frac {1}{2}\\ -\frac {1}{2} & +\frac {1}{2}\\ +\frac {1}{2} & -\frac {1}{2}\\ +\frac {1}{2} & +\frac {1}{2}\end {bmatrix}$ We go over each row one at a time. Trying the ﬁrst row $$s=\left \{ \frac {-1}{2},\frac {-1}{2}\right \}$$ which means $$s_{0}=\frac {-1}{2},s_{1}=\frac {-1}{2}$$. Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-1,\theta _{fixed}=\frac {1}{2x}\frac {3x-2}{x-1}$$ then\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\\ & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( 1\right ) -\left ( s_{1}e_{1}\right ) \\ & =-1-\frac {1}{2}-\left ( \frac {-1}{2}\left ( 3\right ) \right ) \\ & =0 \end {align*}

Since $$d\geq 0$$, then we can use it. Now  using Eq (8) gives\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i}\\ & =\left ( 1\right ) \left ( \frac {1}{2x}\frac {3x-2}{x-1}\right ) +\left ( s_{0}\theta _{0}+s_{1}\theta _{1}\right ) \\ & =\frac {1}{2x}\frac {3x-2}{x-1}+\left ( \frac {-1}{2}\theta _{0}-\frac {1}{2}\theta _{1}\right ) \\ & =\frac {1}{2x}\frac {3x-2}{x-1}-\frac {1}{2}\left ( 0\right ) -\frac {1}{2}\frac {3}{x-1} \end {align*}

Therefore$\Theta =-\frac {1}{x\left ( x-1\right ) }$ Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$\omega$$ if possible.

Step 3

The input to this step is the integer $$d=0$$ and $$\Theta =-\frac {1}{x\left ( x-1\right ) }$$ found from step 2 and also $$r=\frac {2}{x\left ( x-1\right ) ^{2}}$$ which comes from $$z^{\prime \prime }=rz$$. This step is broken into these parts. First we ﬁnd the $$p_{-1}\left ( x\right )$$ polynomial. If we are to solve for its coeﬃcients, then next we build the minimal polynomial from the $$p_{i}\left ( x\right )$$ polynomials constructed during ﬁnding $$p_{-1}\left ( x\right )$$. The minimal polynomial $$p_{\min }\left ( x\right )$$ will be a function of $$\omega$$. Next we solve for $$\omega$$ from $$p_{\min }\left ( x\right ) =0$$. If this is successful, then we have found $$\omega$$ and the ﬁrst solution to the ode $$z^{\prime \prime }=rz$$ is $$z=e^{\int \omega dx}\,$$. Below shows how this is done.

We start by forming a polynomial\begin {align*} p\left ( x\right ) & =x^{d}+a_{d-1}x^{d-1}+\cdots +a_{0}\\ & =1 \end {align*}

Since this is case $$n=1$$ then\begin {align*} \omega & =\frac {p^{\prime }}{p}+\Theta \\ & =0-\frac {1}{x\left ( x-1\right ) }\\ & =\frac {-1}{x\left ( x-1\right ) } \end {align*}

Before using this, we will verify it is correct. For case 1 the above should satisfy$\omega ^{\prime }+\omega ^{2}=r$ Let us see if this is the case or not.\begin {align*} \frac {d}{dx}\left ( -\frac {1}{x\left ( x-1\right ) }\right ) +\left ( -\frac {1}{x\left ( x-1\right ) }\right ) ^{2} & =\frac {2}{x\left ( x-1\right ) ^{2}}\\ \frac {1}{x^{2}}\frac {2x-1}{\left ( x-1\right ) ^{2}}+\left ( -\frac {1}{x\left ( x-1\right ) }\right ) ^{2} & =\frac {2}{x\left ( x-1\right ) ^{2}}\\ \frac {2}{x\left ( x-1\right ) ^{2}} & =\frac {2}{x\left ( x-1\right ) ^{2}} \end {align*}

Veriﬁed. Since solution $$\omega$$ is found and veriﬁed, then ﬁrst solution to the ode is \begin {align*} z & =e^{\int -\frac {1}{x\left ( x-1\right ) }dx}\\ & =e^{\ln x-\ln \left ( x-1\right ) }\\ & =\frac {x}{x-1} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y & =ze^{\frac {-1}{2}\int adx}\\ & =\frac {x}{x-1}e^{-\frac {1}{2}\int 0dx}\\ & =\frac {x}{x-1} \end {align*}

##### 4.1.3 Example 3 case one

Solve \begin {align} y^{\prime \prime }-x^{2}y^{\prime }-x^{2}y & =0\tag {1}\\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =-x^{2}\\ b & =-x^{2} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}x^{4}-x+x^{2}\nonumber \\ & =\frac {x^{4}+4x^{2}-4x}{4} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\left ( \frac {x^{4}+4x^{2}-4x}{4}\right ) z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =x^{4}+4x^{2}-4x\\ t & =4 \end {align*}

The free square factorization of $$t$$ is $$t=\left [ \left [ {}\right ] \right ]$$. Hence \begin {equation} m=0 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =1 \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =0-4\\ & =-4 \end {align*}

There are no poles. Looking at the cases table giving up, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 1 meets the necessary conditions. Hence $$L=\left [ 1\right ]$$. So $$n=1.$$

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =-4,t=4,t_{1}=4$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( -4,2\right ) -0-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( -4\right ) \\ & =-1\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4\right ) }{\left ( 4\right ) }+3\left ( \frac {\left ( 4\right ) ^{\prime }}{4}\right ) \right ) \\ & =0 \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$. These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. From above we found that $$t_{2}=1$$. Label these poles $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. The zeros of $$t_{2}$$ are $$\left \{ {}\right \}$$. There are no zeros since constant. Therefore $$k_{2}=0$$ since one zero. Hence $M=0$ No $$e_{i},\theta _{i}$$ are generated. i.e. $$e=\left \{ {}\right \} ,\theta =\left \{ {}\right \}$$ so far.

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Since non exist here. This is skipped. Hence $$M$$ stays $$0$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since in this example $$O\left ( \infty \right ) =-4$$ then none of these cases apply. We fall into the case that handles $$n=1$$ only which is the current case which results in $$e_{0}=-2,\theta _{0}=2+x^{2}$$. Hence\begin {align*} e & =\left \{ -2\right \} \\ \theta & =\left \{ 2+x^{2}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$. Since $$n=1$$ and $$M=0$$ then we have $$\left ( n+1\right ) ^{M+1}=2^{1}=2$$ sets $$s$$ to try. These are given by$\Lambda =\begin {bmatrix} -\frac {1}{2}\\ +\frac {1}{2}\end {bmatrix}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\nonumber \end {equation} Since $$M=0$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} Since $$M=0$$. Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-1,\theta _{fixed}=0$$ then\begin {align*} d & =\left ( n\right ) \left ( e_{fix}\right ) +\left ( \frac {-1}{2}\right ) \left ( -2\right ) \\ & =\left ( 1\right ) \left ( -1\right ) +1\\ & =0 \end {align*}

Since $$d\geq 0$$, then we can use it. Using Eq (8) gives\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}\\ & =0-\frac {1}{2}\left ( 2+x^{2}\right ) \\ & =-1-\frac {1}{2}x^{2} \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$\omega$$ if possible.

Step 3

The input to this step is the integer $$d=0$$ and $$\Theta =-1-\frac {1}{2}x^{2}$$ found from step 2 and also $$r=\frac {x^{4}+4x^{2}-4x}{4}$$ which comes from $$z^{\prime \prime }=rz$$. This step is broken into these parts. First we ﬁnd the $$p_{-1}\left ( x\right )$$ polynomial. If we are to solve for its coeﬃcients, then next we build the minimal polynomial from the $$p_{i}\left ( x\right )$$ polynomials constructed during ﬁnding $$p_{-1}\left ( x\right )$$. The minimal polynomial $$p_{\min }\left ( x\right )$$ will be a function of $$\omega$$. Next we solve for $$\omega$$ from $$p_{\min }\left ( x\right ) =0$$. If this is successful, then we have found $$\omega$$ and the ﬁrst solution to the ode $$y^{\prime \prime }=ry$$ is $$e^{\int \omega dx}\,$$. Below shows how this is done.

We start by forming a polynomial\begin {align*} p\left ( x\right ) & =x^{d}+a_{d-1}x^{d-1}+\cdots +a_{0}\\ & =1 \end {align*}

Since this is case $$n=1$$ then\begin {align*} \omega & =\frac {p^{\prime }}{p}+\Theta \\ & =-1-\frac {1}{2}x^{2} \end {align*}

Before using this, we will verify it is correct. For case 1 the above should satisfy$\omega ^{\prime }+\omega ^{2}=r$ Let us see if this is the case or not.\begin {align*} \frac {d}{dx}\left ( -1-\frac {1}{2}x^{2}\right ) +\left ( -1-\frac {1}{2}x^{2}\right ) ^{2} & =\left ( \frac {x^{4}+4x^{2}-4x}{4}\right ) \\ -x+\frac {1}{4}x^{4}+x^{2}+1 & =\frac {x^{4}+4x^{2}-4x}{4}\\ \frac {x^{4}+4x^{2}-4x}{4}+\frac {1}{4} & =\frac {x^{4}+4x^{2}-4x}{4} \end {align*}

It did not verify. This means this solution can not be used. If we try the next row in $$\Lambda$$ we will ﬁnd it gives negative $$d$$. This means there is no Liouvillian solution. This is an example where even if we ﬁnd $$d\geq 0$$ we still can end up not ﬁnding a solution.

##### 4.1.4 Example 4 case one

Solve \begin {align} \left ( x^{3}+1\right ) y^{\prime \prime }+7x^{2}y^{\prime }+9xy & =0\tag {1}\\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =\frac {7x^{2}}{\left ( x^{3}+1\right ) }\\ b & =\frac {9x}{\left ( x^{3}+1\right ) } \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( \frac {7x^{2}}{\left ( x^{3}+1\right ) }\right ) ^{2}+\frac {1}{2}\left ( \frac {d}{dx}\left ( \frac {7x^{2}}{\left ( x^{3}+1\right ) }\right ) \right ) -\frac {9x}{\left ( x^{3}+1\right ) }\nonumber \\ & =\frac {1}{4}\left ( \frac {7x^{2}}{\left ( x^{3}+1\right ) }\right ) ^{2}+\frac {1}{2}\left ( \frac {-7x\left ( x^{3}-2\right ) }{\left ( x^{3}+1\right ) ^{2}}\right ) -\frac {9x}{\left ( x^{3}+1\right ) }\nonumber \\ & =\frac {-x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=-\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =-x\left ( x^{3}+8\right ) \\ t & =4\left ( x^{3}+1\right ) ^{2} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,x^{3}+1\right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =x^{3}+1 \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =6-4\\ & =2 \end {align*}

There are three poles each of order 2. Looking at the cases table giving up, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that all three cases are possible. Hence $$L=\left [ 1,2,4,6,12\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =2,t=4\left ( x^{3}+1\right ) ^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 2,2\right ) -6-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 2-6\right ) \\ & =-1\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4\left ( x^{3}+1\right ) ^{2}\right ) }{4\left ( x^{3}+1\right ) ^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {3}{2}\frac {x^{2}}{x^{3}+1} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$.

$r=-\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}}$ These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. From above we found that $t_{2}=x^{3}+1$ Label these zeros of $$t_{2}$$ as $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. The zeros of $$t_{2}$$ are $$\left \{ -1,\left ( -1\right ) ^{\frac {1}{3}},-\left ( -1\right ) ^{\frac {1}{3}}\right \} =\left \{ -1,\frac {1}{2}-\frac {1}{2}i\sqrt {3},\frac {1}{2}+\frac {1}{2}i\sqrt {3}\right \}$$. Therefore $$k_{2}=3$$. Hence $M=3$ Now we iterate over each zero $$c_{i}$$ times ﬁnding $$e_{i}$$ and $$\theta _{i}$$ from each. These are found to be (following formula in paper) to be \begin {align*} b_{1} & =\frac {7}{36}\\ e_{1} & =\frac {4}{3}\\ b_{2} & =\frac {7}{36}\\ e_{2} & =\frac {4}{3}\\ b_{3} & =\frac {7}{36}\\ e_{3} & =\frac {4}{3} \end {align*}

And\begin {align*} \theta _{1} & =\frac {4}{3\left ( x+1\right ) }\\ \theta _{2} & =\frac {8}{3\left ( i\sqrt {3}+2x-1\right ) }\\ \theta _{3} & =\frac {-8}{3\left ( i\sqrt {3}-2x+1\right ) } \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Since non exist here. This is skipped. Hence $$M$$ stays $$3$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since in this example $$O\left ( \infty \right ) =2$$ then this case applies. $$b=\frac {lcoeff\left ( s\right ) }{lcoeff\left ( t\right ) }$$ where $$lcoeff$$ gives the leading coeﬃcient. Since $$s=-x\left ( x^{3}+8\right ) =-x^{4}-8x$$ then $$lcoeff\left ( s\right )$$ $$=-1$$. And since $$t=4\left ( x^{3}+1\right ) ^{2}=4x^{6}+8x^{3}+4$$ then $$lcoeff\left ( t\right ) =4$$. Therefore $$b=\frac {-1}{4}$$ and therefore

\begin {align*} e_{0} & =\sqrt {1+4b}\\ & =0 \end {align*}

Hence now we have\begin {align*} e & =\left \{ 0,\frac {4}{3},\frac {4}{3},\frac {4}{3}\right \} \\ \theta & =\left \{ 0,\frac {4}{3\left ( x+1\right ) },\frac {8}{3\left ( i\sqrt {3}+2x-1\right ) },\frac {-8}{3\left ( i\sqrt {3}-2x+1\right ) }\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$M=3$$ then there are $$\left ( n+1\right ) ^{M+1}=2^{4}=16$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2},\frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\nonumber \end {equation} Since $$M=3$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1}-s_{2}e_{2}-s_{3}e_{3} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-1,\theta _{fixed}=\frac {3}{2}\frac {x^{2}}{x^{3}+1}$$ gives\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( 0\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {4}{3}\right ) -\left ( -\frac {1}{2}\right ) \left ( \frac {4}{3}\right ) -\left ( -\frac {1}{2}\right ) \left ( \frac {4}{3}\right ) \\ & =1 \end {align*}

Since $$d\geq 0$$, then we can use it. Using Eq (8) gives (using $$M=3$$)\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}+s_{2}\theta _{2}+s_{3}\theta _{3}\\ & =\left ( 1\right ) \left ( \frac {3}{2}\frac {x^{2}}{x^{3}+1}\right ) +\left ( \frac {-1}{2}\right ) \left ( 0\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {4}{3\left ( x+1\right ) }\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {8}{3\left ( i\sqrt {3}+2x-1\right ) }\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {-8}{3\left ( i\sqrt {3}-2x+1\right ) }\right ) \\ & =\left ( \frac {3}{2}\frac {x^{2}}{x^{3}+1}\right ) -\frac {2}{3\left ( x+1\right ) }-\frac {4}{3\left ( i\sqrt {3}+2x-1\right ) }+\frac {4}{3\left ( i\sqrt {3}-2x+1\right ) }\\ & =\frac {2x^{2}}{\left ( x+1\right ) \left ( i\sqrt {3}+2x-1\right ) \left ( i\sqrt {3}-2x+1\right ) }\\ & =\frac {-x^{2}}{2x^{3}+2} \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$\omega$$ if possible.

Step 3

The input to this step is the integer $$d=1$$ and $$\Theta =\frac {-x^{2}}{2x^{3}+2}$$ found from step 2 and also $$r=-\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}}$$ which comes from $$z^{\prime \prime }=rz$$. This step is broken into these parts. First we ﬁnd the $$p_{-1}\left ( x\right )$$ polynomial. If we are to solve for its coeﬃcients, then next we build the minimal polynomial from the $$p_{i}\left ( x\right )$$ polynomials constructed during ﬁnding $$p_{-1}\left ( x\right )$$. The minimal polynomial $$p_{\min }\left ( x\right )$$ will be a function of $$\omega$$. Next we solve for $$\omega$$ from $$p_{\min }\left ( x\right ) =0$$. If this is successful, then we have found $$\omega$$ and the ﬁrst solution to the ode $$y^{\prime \prime }=ry$$ is $$e^{\int \omega dx}\,$$. Below shows how this is done.

We start by forming a polynomial\begin {align*} p\left ( x\right ) & =x^{d}+a_{d-1}x^{d-1}+\cdots +a_{0}\\ & =x \end {align*}

Since this is case $$n=1$$ then\begin {align*} \omega & =\frac {p^{\prime }}{p}+\Theta \\ & =\frac {1}{x}-\frac {x^{2}}{2x^{3}+2}\\ & =\frac {x^{3}+2}{2x\left ( x^{3}+1\right ) } \end {align*}

Before using this, we will verify it is correct. For case 1 the above should satisfy

$\omega ^{\prime }+\omega ^{2}=r$ Let us see if this is the case or not.\begin {align*} \frac {d}{dx}\left ( \frac {x^{3}+2}{2x\left ( x^{3}+1\right ) }\right ) +\left ( \frac {x^{3}+2}{2x\left ( x^{3}+1\right ) }\right ) ^{2} & =-\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}}\\ -\frac {\left ( x^{6}+6x^{3}+2\right ) }{2x^{2}\left ( x^{3}+1\right ) ^{2}}+\frac {\left ( x^{3}+2\right ) ^{2}}{4x^{2}\left ( x^{3}+1\right ) ^{2}} & =-\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}}\\ -\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}} & =-\frac {x\left ( x^{3}+8\right ) }{4\left ( x^{3}+1\right ) ^{2}} \end {align*}

Veriﬁed. Since solution $$\omega$$ is found and veriﬁed, then ﬁrst solution to the ode is \begin {align*} z & =e^{\int \omega dx}\\ & =e^{\int \frac {x^{3}+2}{2x\left ( x^{3}+1\right ) }dx}\\ & =\frac {x}{\sqrt {x^{3}+1}} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y & =ze^{\frac {-1}{2}\int adx}\\ & =\frac {x}{\sqrt {x^{3}+1}}e^{-\frac {1}{2}\int \frac {7x^{2}}{\left ( x^{3}+1\right ) }dx}\\ & =\frac {x}{\sqrt {x^{3}+1}}\frac {1}{\left ( x^{3}+1\right ) ^{\frac {7}{6}}}\\ & =\frac {x}{\left ( x^{3}+1\right ) ^{\frac {4}{3}}} \end {align*}

##### 4.1.5 Example 5 case one

Solve Bessel ode (from Kovacic original paper) \begin {align} y^{\prime \prime }-\frac {4\left ( m^{2}-x^{2}\right ) -1}{4x^{2}}y & =0\tag {1}\\ y^{\prime \prime }+ay^{\prime }+by & =0\nonumber \end {align}

Hence \begin {align*} a & =0\\ b & =\frac {4\left ( m^{2}-x^{2}\right ) -1}{4x^{2}} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {4\left ( m^{2}-x^{2}\right ) -1}{4x^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {4\left ( m^{2}-x^{2}\right ) -1}{4x^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =4\left ( m^{2}-x^{2}\right ) -1\\ t & =4x^{2} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,x\right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this case we set\begin {align*} t_{1} & =1\\ t_{2} & =x \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =2-2\\ & =0 \end {align*}

There is one pole at $$x=0$$ of order 2. Looking at the cases table giving up, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 1,2 are possible. $$L=\left [ 1,2\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =0,t=4x^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 0,2\right ) -2-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 0-2\right ) \\ & =-\frac {1}{2}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4x^{2}\right ) }{4x^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{2x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$.

$r=\frac {4\left ( m^{2}-x^{2}\right ) -1}{4x^{2}}$ These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. From above we found that $t_{2}=x$ Label these zeros of $$t_{2}$$ as $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. The zeros of $$t_{2}$$ are $$\left \{ 0\right \}$$. Therefore $$k_{2}=1$$. Hence $M=1$ Now we iterate over each zero $$c_{i}$$ times ﬁnding $$e_{i}$$ and $$\theta _{i}$$ from each. These are found to be (following formula in paper) to be \begin {align*} b_{1} & =m^{2}-\frac {1}{4}\\ e_{1} & =\sqrt {1+4b}=\sqrt {1+4\left ( m^{2}-\frac {1}{4}\right ) }=2m\qquad m>0 \end {align*}

Where $$b_{1}$$ is the coeﬃcient of $$\frac {1}{\left ( x-c_{1}\right ) ^{2}}$$ in the partial fractions decomposition of $$r$$ which is $$r=-1+\left ( m^{2}-\frac {1}{4}\right ) \frac {1}{x^{2}}$$.  And$\theta _{1}=\frac {e_{1}}{x-c_{1}}=\frac {2m}{x}$ Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Since non exist here. This is skipped. Hence $$M$$ stays $$1$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since $$O\left ( \infty \right ) =0$$ here then none of these cases applies. For case 1 $$\left ( n=1\right )$$ following the method in the paper we ﬁnd\begin {align*} e_{0} & =0\\ \theta _{0} & =2i \end {align*}

Hence now we have\begin {align*} e & =\left \{ 0,2m\right \} \\ \theta & =\left \{ 2i,\frac {2m}{x}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$M=1$$ then there are $$\left ( n+1\right ) ^{M+1}=2^{2}=4$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\nonumber \end {equation} Since $$M=1$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{2},\theta _{fixed}=\frac {1}{2x}$$ gives\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 0\right ) -\left ( \frac {-1}{2}\right ) \left ( 2m\right ) \\ & =m-\frac {1}{2} \end {align*}

We now have to assume something about $$m$$ to be to continue otherwise we will not be able to decide if $$d$$ is integer and $$d\geq 0$$. If we assume that $$m$$ is half of all positive odd integers ($$\frac {1}{2},\frac {3}{2},\frac {5}{2},\cdots$$) then $$d\geq 0$$. We can also assume that $$m$$ is half of all negative odd integers and the other $$s$$ set will match. So under the assumption that $$m$$ is half of all positive odd integers the above $$d$$ can be used for the next step.  To continue, we assume $$m$$ takes some speciﬁc value to simplify the steps. Let $$m=\frac {3}{2}$$ from now on. Hence $$d=1$$. Therefore $$e,\theta$$ become

\begin {align*} e & =\left \{ 0,3\right \} \\ \theta & =\left \{ 2i,\frac {3}{x}\right \} \end {align*}

Using Eq (8) gives (using $$M=1$$)\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}\\ & =\left ( 1\right ) \left ( \frac {1}{2x}\right ) +\left ( \frac {-1}{2}\right ) \left ( 2i\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {3}{x}\right ) \\ & =-\frac {1}{x}\left ( ix+1\right ) \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$\omega$$ if possible.

Step 3

The input to this step is the integer $$d=1$$ and $$\Theta =-\frac {1}{x}\left ( ix+1\right )$$ found from step 2 and also $$r=\frac {4\left ( n^{2}-x^{2}\right ) -1}{4x^{2}}$$ which comes from $$z^{\prime \prime }=rz$$. This step is broken into these parts. First we ﬁnd the $$p_{-1}\left ( x\right )$$ polynomial. If we are to solve for its coeﬃcients, then next we build the minimal polynomial from the $$p_{i}\left ( x\right )$$ polynomials constructed during ﬁnding $$p_{-1}\left ( x\right )$$. The minimal polynomial $$p_{\min }\left ( x\right )$$ will be a function of $$\omega$$. Next we solve for $$\omega$$ from $$p_{\min }\left ( x\right ) =0$$. If this is successful, then we have found $$\omega$$ and the ﬁrst solution to the ode $$y^{\prime \prime }=ry$$ is $$e^{\int \omega dx}\,$$. Below shows how this is done.

We start by forming a polynomial \begin {align*} p\left ( x\right ) & =x^{d}+a_{d-1}x^{d-1}+\cdots +a_{0}\\ & =x+a_{0} \end {align*}

The goal is to solve for the $$a_{0}$$ coeﬃcient. Now depending on case  number $$n$$, we do the following. Since we are in case $$n=1$$ then\begin {align*} p_{1} & =-p\\ & =-x-a_{0}\\ p_{0} & =-p_{1}^{\prime }-\Theta p_{1}\\ & =-\left ( -x-a_{0}\right ) ^{\prime }-\left ( -\frac {1}{x}\left ( ix+1\right ) \right ) \left ( -x-a_{0}\right ) \\ & =1-\left ( -\frac {1}{x}\left ( ix+1\right ) \right ) \left ( -x-a_{0}\right ) \\ & =-\frac {1}{x}\left ( ix^{2}+ia_{0}x+a_{0}\right ) \\ p_{-1} & =-p_{0}^{\prime }-\Theta p_{0}-\left ( 1\right ) \left ( 1\right ) rp_{1}\\ & =-\left ( -\frac {1}{x}\left ( ix^{2}+ia_{0}x+a_{0}\right ) \right ) ^{\prime }-\left ( -\frac {1}{x}\left ( ix+1\right ) \right ) \left ( -\frac {1}{x}\left ( ix^{2}+ia_{0}x+a_{0}\right ) \right ) -\frac {4\left ( n^{2}-x^{2}\right ) -1}{4x^{2}}\left ( -x-a_{0}\right ) \\ & =-\frac {2}{x}\left ( ia_{0}-1\right ) \end {align*}

Now we try to solve for $$a_{i}$$ using $$p_{-1}\left ( x\right ) =0$$. This gives $$a_{0}=-i$$.  Hence this implies$p\left ( x\right ) =x-i$ Since this is case $$n=1$$ then\begin {align*} \omega & =\frac {p^{\prime }}{p}+\Theta \\ & =\frac {\left ( x-i\right ) ^{\prime }}{x-i}-\frac {1}{x}\left ( ix+1\right ) \\ & =\frac {-i\left ( ix-x^{2}+1\right ) }{\left ( -x+i\right ) x}\\ & =-\frac {\left ( ix^{3}+1\right ) }{x^{3}+x} \end {align*}

Before using this, we will verify it is correct. For case 1 the above should satisfy$\omega ^{\prime }+\omega ^{2}=r$ Let us see if this is the case or not. \begin {align*} \frac {d}{dx}\left ( \frac {-i\left ( ix-x^{2}+1\right ) }{\left ( -x+i\right ) x}\right ) +\left ( \frac {-i\left ( ix-x^{2}+1\right ) }{\left ( -x+i\right ) x}\right ) ^{2} & =\frac {4\left ( \left ( \frac {3}{2}\right ) ^{2}-x^{2}\right ) -1}{4x^{2}}\\ \frac {\left ( -2ix^{3}+3x^{2}+1\right ) }{x^{2}\left ( x^{2}+1\right ) ^{2}}+\frac {\left ( ix^{2}+x-i\right ) ^{2}}{x^{2}\left ( x-i\right ) ^{2}} & =-\frac {1}{x^{2}}\left ( x^{2}-2\right ) \\ -\frac {1}{x^{2}}\left ( x^{2}-2\right ) & =-\frac {1}{x^{2}}\left ( x^{2}-2\right ) \end {align*}

Veriﬁed. Hence $$\omega =\frac {-i\left ( ix-x^{2}+1\right ) }{\left ( -x+i\right ) x}=-\frac {\left ( ix^{3}+1\right ) }{x^{3}+x}$$ will give the solution to the ode $$y^{\prime \prime }-\frac {4\left ( m^{2}-x^{2}\right ) -1}{4x^{2}}y=0$$ when $$m=\frac {3}{2}$$. Since solution $$\omega$$ is found and veriﬁed, then ﬁrst solution to the ode is \begin {align*} z & =e^{\int \omega dx}\\ & =e^{\int -\frac {\left ( ix^{3}+1\right ) }{x^{3}+x}dx}\\ & =\frac {1}{x}e^{-ix}\left ( x-i\right ) \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y & =ze^{\frac {-1}{2}\int adx}\\ & =\frac {1}{x}e^{-ix}\left ( x-i\right ) e^{-\frac {1}{2}\int 0dx}\\ & =\frac {1}{x}e^{-ix}\left ( x-i\right ) \end {align*}

One diﬃculty in implementation of Kovacic algorithm using an ode with a parameter $$m$$ like in this Bessel ode example, is that it makes it hard to decide if $$d\geq 0$$ or not. So in practice, it is better to use this algorithm for speciﬁc values of any parameters that can be involved.

##### 4.1.6 Example 6 case one

Solve \begin {equation} y^{\prime \prime }=\frac {4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4}{4x^{4}}y \tag {1} \end {equation} Hence \begin {align*} a & =0\\ b & =-\frac {4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4}{4x^{4}} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4}{4x^{4}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4}{4x^{4}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4\\ t & =4x^{4} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,1,1,x\right ]$$. Hence\begin {equation} m=4 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this case we set\begin {align*} t_{1} & =1\\ t_{2} & =1 \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =4-6\\ & =-2 \end {align*}

There is one pole at $$x=0$$ of order 4. Looking at the cases table

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 1 is possible. $$L=\left [ 1\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =0,t=4x^{4},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( -2,2\right ) -4-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( -2-4\right ) \\ & =-\frac {3}{2}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4x^{4}\right ) }{4x^{4}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$. Since $$t_{2}=1$$ then there are poles. Hence $$k_{2}=0$$ and $M=0$ Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Here we have pole $$x=0$$ of order 4. Following the paper (need to document), we ﬁnd $$e_{1}=-5,\theta _{1}=\frac {2}{x^{2}}-\frac {5}{x}$$. We start from index $$1$$ since $$k_{2}=0$$ from part (b). Now $$k_{1}=1$$. Note that for case 1, we use $$k_{1}$$. Hence $M=1$ And now not $$M=0$$ (for case 1 only). For other cases, we use $$k_{2}$$ for $$M$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since $$O\left ( \infty \right ) =0$$ here then none of these cases applies. For case 1 $$\left ( n=1\right )$$ following the method in the paper we ﬁnd (need to document)\begin {align*} e_{0} & =2\\ \theta _{0} & =-2+2x \end {align*}

Hence now we have\begin {align*} e & =\left \{ 2,-5\right \} \\ \theta & =\left \{ -2+2x,\frac {2}{x^{2}}-\frac {5}{x}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$M=k_{1}=1$$ then there are $$\left ( n+1\right ) ^{M+1}=2^{2}=4$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\nonumber \end {equation} Since $$M=1$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {3}{2},\theta _{fixed}=\frac {1}{x}$$ gives\begin {align*} d & =\left ( 1\right ) \left ( -\frac {3}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 2\right ) -\left ( \frac {-1}{2}\right ) \left ( -5\right ) \\ & =-5 \end {align*}

Since this is not $$\geq 0$$, we go to next set $$s$$ $$\left \{ \frac {+1}{2},\frac {+1}{2}\right \}$$ and try again\begin {align*} d & =\left ( 1\right ) \left ( -\frac {3}{2}\right ) +\left ( \frac {+1}{2}\right ) \left ( 2\right ) -\left ( \frac {+1}{2}\right ) \left ( -5\right ) \\ & =2 \end {align*}

This works. Using Eq (8) gives (using $$M=1$$)\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}\\ & =\left ( 1\right ) \left ( \frac {1}{x}\right ) +\left ( \frac {+1}{2}\right ) \left ( -2+2x\right ) +\left ( \frac {+1}{2}\right ) \left ( \frac {2}{x^{2}}-\frac {5}{x}\right ) \\ & =-\frac {\left ( -2x^{3}+2x^{2}+3x-2\right ) }{2x^{2}}\\ & =x-1-\frac {3}{2x}+\frac {1}{x^{2}} \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$P\left ( x\right )$$ if possible.

Step 3

The input to this step is the integer $$d=2$$ and $$\Theta =x-1-\frac {3}{2x}+\frac {1}{x^{2}}$$ found from step 2 and also $$r=\frac {4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4}{4x^{4}}$$ which comes from $$z^{\prime \prime }=rz$$.  Since degree $$d=2$$, then let $$p\left ( x\right ) =x^{2}+ax+b$$. Therefore we need to now ﬁnd $$P\left ( x\right )$$ that solves

\begin {align*} P^{\prime \prime }+2\Theta P^{\prime }+\left ( \Theta ^{\prime }+\Theta ^{2}-r\right ) P & =0\\ 2+2\Theta \left ( 2x+a\right ) +\left ( \Theta ^{\prime }+\Theta ^{2}-r\right ) \left ( x^{2}+ax+b\right ) & =0\\ 2+2\left ( x-1-\frac {3}{2x}+\frac {1}{x^{2}}\right ) \left ( 2x+a\right ) +\left ( \left ( x-1-\frac {3}{2x}+\frac {1}{x^{2}}\right ) ^{\prime }+\left ( x-1-\frac {3}{2x}+\frac {1}{x^{2}}\right ) ^{2}-\frac {4x^{6}-8x^{5}+12x^{4}+4x^{3}+7x^{2}-20x+4}{4x^{4}}\right ) \left ( x^{2}+ax+b\right ) & =0 \end {align*}

Which simpliﬁes to\begin {align*} -\frac {1}{x^{2}}\left ( 2ax^{3}-4x-2ax^{2}-2a+4bx^{2}+3ax-4bx+4x^{2}\right ) & =0\\ -2ax+\frac {4}{x}+2a+2\frac {a}{x^{2}}-4b-3a\frac {1}{x}+4\frac {b}{x}-4 & =0 \end {align*}

Hence by comparing coeﬃcients$x\left ( -2a\right ) +\frac {1}{x}\left ( 4-3a+4b\right ) +\frac {1}{x^{2}}\left ( 2a\right ) +\left ( 2a-4b-4\right ) =0$ Therefore $$a=0$$. And $$4-3a+4b=0$$ gives $$b=-1$$. Same if we used $$2a-4b-4=0$$, So consistent equations. Therefore $P\left ( x\right ) =x^{2}-1$ And the solution is\begin {align*} z & =P\left ( x\right ) e^{\int \Theta dx}\\ & =\left ( x^{2}-1\right ) e^{\int x-1-\frac {3}{2x}+\frac {1}{x^{2}}dx}\\ & =\left ( x^{2}-1\right ) x^{-\frac {3}{2}}e^{-\frac {1}{x}+\frac {x^{2}}{2}-x} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y & =\left ( x^{2}-1\right ) x^{-\frac {3}{2}}e^{-\frac {1}{x}+\frac {x^{2}}{2}-x}e^{\frac {-1}{2}\int adx}\\ & =\left ( x^{2}-1\right ) x^{-\frac {3}{2}}e^{-\frac {1}{x}+\frac {x^{2}}{2}-x}e^{-\frac {1}{2}\int 0dx}\\ & =\left ( x^{2}-1\right ) x^{-\frac {3}{2}}e^{-\frac {1}{x}+\frac {x^{2}}{2}-x} \end {align*}

##### 4.1.7 Example 7 case two

Solve \begin {align} y^{\prime \prime } & =\frac {16x-3}{16x^{2}}y\tag {1}\\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =0\\ b & =-\frac {16x-3}{16x^{2}} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {16x-3}{16x^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {16x-3}{16x^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =16x-3\\ t & =16x^{2} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,x\right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =x \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =2-1\\ & =1 \end {align*}

There is pole $$x=0$$ of order 2. Looking at the cases table, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 2 is possible (due to $$O\left ( \infty \right ) =1$$ which is not allowed other than for case 2). Hence $$L=\left [ 2\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =1,t=16x^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 1,2\right ) -2-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 1-2\right ) \\ & =-\frac {1}{4}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 16x^{2}\right ) }{16x^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{2x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$.$r=\frac {16x-3}{16x^{2}}$ These will be the zeros of $$t_{2}$$ in the above square free factorization of $$t$$. From above we found that $t_{2}=x$ Label these zeros of $$t_{2}$$ as $$c_{1},c_{2},\cdots ,c_{k_{2}}$$. The zeros of $$t_{2}$$ are $$\left \{ 0\right \}$$. Therefore $$k_{2}=1$$. Hence $M=1$ Now we iterate over each zero $$c_{i}$$ times ﬁnding $$e_{i}$$ and $$\theta _{i}$$ from each. These are found to be (following formula in paper) to be $e_{1}=\frac {1}{2}$ And$\theta _{1}=\frac {1}{2x}$ Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,M$$ if any exist. Since only case 2 exist in this example. This is skipped. Hence $$M$$ stays $$1$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. None of these apply, and this is not case 1. Hence \begin {align*} e_{0} & =0\\ \theta _{0} & =0 \end {align*}

Hence now we have\begin {align*} e & =\left \{ 0,\frac {1}{2}\right \} \\ \theta & =\left \{ 0,\frac {1}{2x}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=2$$.  Since case 2 only applies here. And since we have $$M=1$$ then there are $$\left ( n+1\right ) ^{M+1}=3^{2}=9$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2}\right \} =\left \{ -1,-1\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{M}s_{i}e_{i}\nonumber \end {equation} Since $$M=1$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{M}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{4},\theta _{fixed}=\frac {1}{2x}$$ gives\begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{4}\right ) +\left ( -1\right ) \left ( 0\right ) -\left ( -1\right ) \left ( \frac {1}{2}\right ) \\ & =0 \end {align*}

Since $$d\geq 0$$, then we can use it. Using Eq (8) gives (using $$M=1$$)\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}\\ & =\left ( 2\right ) \left ( \frac {1}{2x}\right ) +\left ( -1\right ) \left ( 0\right ) +\left ( -1\right ) \left ( \frac {1}{2x}\right ) \\ & =\frac {1}{2x} \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$P\left ( x\right )$$ if possible.

Step 3

The input to this step is the integer $$d=0$$ and $$\Theta =\frac {1}{2x}$$ found from step 2 and also $$r=\frac {16x-3}{16x^{2}}$$ which comes from $$z^{\prime \prime }=rz$$. We need now to ﬁnd $$P\left ( x\right )$$ of degree $$d=0$$ which is a constant such that $P^{\prime \prime \prime }+3\Theta P^{\prime \prime }+\left ( 3\Theta ^{2}+3\Theta ^{\prime }-4r\right ) P^{\prime }+\left ( \Theta ^{\prime \prime }+3\Theta \Theta ^{\prime }+\Theta ^{3}-4r\Theta -2r^{\prime }\right ) P=0$ Since $$P=1$$ then above simpliﬁes to$\left ( \Theta ^{\prime \prime }+3\Theta \Theta ^{\prime }+\Theta ^{3}-4r\Theta -2r^{\prime }\right ) =0$ We know $$\Theta$$ and $$r$$. If this veriﬁes, then we can use $$P=1$$. Substituting the above becomes\begin {align*} \left ( \left ( \frac {1}{2x}\right ) ^{\prime \prime }+3\frac {1}{2x}\left ( \frac {1}{2x}\right ) ^{\prime }+\left ( \frac {1}{2x}\right ) ^{3}-4\left ( \frac {16x-3}{16x^{2}}\right ) \left ( \frac {1}{2x}\right ) -2\left ( \frac {16x-3}{16x^{2}}\right ) ^{\prime }\right ) & =0\\ \left ( \frac {d^{2}}{dx^{2}}\left ( \frac {1}{2x}\right ) +3\frac {1}{2x}\frac {d}{dx}\left ( \frac {1}{2x}\right ) +\left ( \frac {1}{2x}\right ) ^{3}-4\left ( \frac {16x-3}{16x^{2}}\right ) \left ( \frac {1}{2x}\right ) -2\frac {d}{dx}\left ( \frac {16x-3}{16x^{2}}\right ) \right ) & =0\\ 0 & =0 \end {align*}

Veriﬁed. Hence $P\left ( x\right ) =1$ Let \begin {align*} \phi & =\Theta +\frac {P^{\prime }}{P}\\ & =\frac {1}{2x} \end {align*}

Now we solve for $$\omega$$ from \begin {align*} \omega ^{2}-\phi \omega +\left ( \frac {1}{2}\phi ^{\prime }+\frac {1}{2}\phi -r\right ) & =0\\ \omega ^{2}-\frac {1}{2x}\omega +\left ( \frac {1}{2}\left ( \frac {1}{2x}\right ) ^{\prime }+\frac {1}{2}\left ( \frac {1}{2x}\right ) -\frac {16x-3}{16x^{2}}\right ) & =0\\ \omega ^{2}-\frac {1}{2x}\omega +\frac {1}{16x^{2}}-\frac {1}{x} & =0 \end {align*}

The solution $$\ \omega =\frac {1}{4x}\pm \frac {1}{\sqrt {x}}$$. We pick either solution. Hence the solution is\begin {align*} z & =e^{\int \omega dx}\\ & =e^{\int \frac {1}{4x}+\frac {1}{\sqrt {x}}dx}\\ & =x^{\frac {1}{4}}e^{2\sqrt {x}} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y & =ze^{\frac {-1}{2}\int adx}\\ & =x^{\frac {1}{4}}e^{2\sqrt {x}}e^{-\frac {1}{2}\int 0dx}\\ & =x^{\frac {1}{4}}e^{2\sqrt {x}} \end {align*}

##### 4.1.8 Example 8 case two

Solve \begin {align} y^{\prime \prime } & =\frac {1}{x^{3}}y\tag {1}\\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =0\\ b & =-\frac {1}{x^{3}} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{x^{3}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {1}{x^{3}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =1\\ t & =x^{3} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,1,x\right ]$$. Hence\begin {equation} m=3 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =1 \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =3-0\\ & =3 \end {align*}

There is pole $$x=0$$ of order 3. Looking at the cases table, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 2 is possible (since odd pole is only allowed in case 2). Hence $$L=\left [ 2\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =1,t=x^{3},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 3,2\right ) -3-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 2-3\right ) \\ & =-\frac {1}{4}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( x^{3}\right ) }{x^{3}}+3\left ( 0\right ) \right ) \\ & =\frac {3}{4x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}$$. In other words, the number of poles of $$r$$ that are of order $$2$$. There are no poles of order 2. Hence $$k_{2}=0$$.

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots$$ if any exist. Since only case 2 exist in this example. This is skipped. Hence $$k_{2}$$ stays $$0$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. Hence \begin {align*} e_{0} & =1\\ \theta _{0} & =0 \end {align*}

Hence now we have\begin {align*} e & =\left \{ 1\right \} \\ \theta & =\left \{ 0\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=2$$.  Since case 2 only applies here. And since we have $$k_{2}=0$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=3$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2}\right \} =\left \{ -1\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=0$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{4},\theta _{fixed}=\frac {3}{4x}$$ gives\begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{4}\right ) +\left ( -1\right ) \left ( 1\right ) \\ & =-\frac {3}{2} \end {align*}

Since negative then we can not use it. Now we try the next set $$s=\left \{ 0\right \}$$. Then Eq(7) gives\begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{4}\right ) +\left ( 0\right ) \left ( 1\right ) \\ & =-\frac {1}{2} \end {align*}

Since negative then we can not use it. Now we try the last set $$s=\left \{ +1\right \}$$. Then Eq(7) gives\begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{4}\right ) +\left ( +1\right ) \left ( 1\right ) \\ & =\frac {1}{2} \end {align*}

Since not an integer, then we can not use it. We are run out of sets $$s$$ to try. Therefore there is no Liouvillian solution.

##### 4.1.9 Example 9 case two

Solve \begin {align} 2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-2x\right ) y & =0\tag {1}\\ y^{\prime \prime }-\frac {1}{2x}y^{\prime }+\frac {\left ( 1-2x\right ) }{2x^{2}}y & =0\qquad x\neq 0\nonumber \\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =-\frac {1}{2x}\\ b & =\frac {\left ( 1-2x\right ) }{2x^{2}} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( -\frac {1}{2x}\right ) ^{2}+\frac {1}{2}\frac {d}{dx}\left ( -\frac {1}{2x}\right ) -\frac {\left ( 1-2x\right ) }{2x^{2}}\nonumber \\ & =\frac {16x-3}{16x^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {16x-3}{16x^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =16x-3\\ t & =16x^{2} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,x\right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =x \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =2-1\\ & =1 \end {align*}

There is pole $$x=0$$ of order 2. Looking at the cases table, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 2 is possible ($$O\left ( \infty \right ) =1$$ is only possible for case 2). Hence $$L=\left [ 2\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =1,t=16x^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 1,2\right ) -2-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 1-2\right ) \\ & =-\frac {1}{4}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 16x^{2}\right ) }{16x^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{2x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}=x$$. In other words, the number of poles of $$r$$ that are of order $$2$$. There is one pole of order $$2.$$ Hence $$k_{2}=1$$. the coeﬃcient of $$\frac {1}{\left ( x-0\right ) ^{2}}$$ in the partial fractions of $$r=\frac {16x-3}{16x^{2}}=\frac {1}{x}-\frac {3}{16}\frac {1}{\left ( x-0\right ) ^{2}}$$. Therefore $$b=-\frac {3}{16}$$. Hence $$e_{1}=\sqrt {1+4b}=\sqrt {1+4\left ( -\frac {3}{16}\right ) }=\allowbreak \frac {1}{2}$$ and $$\theta _{1}=\frac {e_{1}}{x-0}=\frac {1}{2x}$$. Hence\begin {align*} e & =\left \{ \frac {1}{2}\right \} \\ \theta & =\left \{ \frac {1}{2x}\right \} \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots$$ if any exist. Since only case 2 exist in this example. This is skipped. Hence $$k_{2}$$ stays $$0$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. Since this is not case 1 and since it is not $$O\left ( \infty \right ) >2$$ and not $$O\left ( \infty \right ) =2$$, then\begin {align*} e_{0} & =0\\ \theta _{0} & =0 \end {align*}

Hence now we have\begin {align*} e & =\left \{ 0,\frac {1}{2}\right \} \\ \theta & =\left \{ 0,\frac {1}{2x}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=2$$.  Since case 2 only applies here. And since we have $$k_{2}=1$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=3^{2}=9$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2}\right \} =\left \{ -1,-1\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=1$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{4},\theta _{fixed}=\frac {1}{2x}$$ gives\begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{4}\right ) +\left ( -1\right ) \left ( 0\right ) -\left ( -1\right ) \left ( \frac {1}{2}\right ) \\ & =0 \end {align*}

We can use this $$d.$$From Eq (8)\begin {align*} \Theta & =\left ( 2\right ) \left ( \frac {1}{2x}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}\\ & =\left ( 2\right ) \left ( \frac {1}{2x}\right ) +\left ( -1\right ) \left ( 0\right ) +\left ( -1\right ) \frac {1}{2x}\\ & =\frac {1}{2x} \end {align*}

Since this is case 2 ($$n=2$$) then we need to ﬁrst ﬁnd $$P\left ( x\right )$$. The degree is $$d=0$$. Hence constant. Say $$P=1$$. But we need to verify this is valid. Setting up the equation$P^{\prime \prime \prime }+3\Theta P^{\prime \prime }+\left ( 3\Theta ^{2}+3\Theta ^{\prime }-4r\right ) P^{\prime }+\left ( \Theta ^{\prime \prime }+3\Theta \Theta ^{\prime }+\Theta ^{3}-4r\Theta -2r^{\prime }\right ) P=0$ Which simpliﬁes to (since $$P=1$$)$\Theta ^{\prime \prime }+3\Theta \Theta ^{\prime }+\Theta ^{3}-4r\Theta -2r^{\prime }=0$ Using $$\Theta =\frac {1}{2x},r=\frac {16x-3}{16x^{2}}$$ the above reduces to $0=0$ Hence $$P\left ( x\right ) =1$$ can be used. Now let \begin {align*} \phi & =\Theta +\frac {P^{\prime }}{P}\\ & =\frac {1}{2x} \end {align*}

We now need to solve for $$\omega$$ from (notice that original Kovacic paper has $$+$$ and not $$-$$ after ﬁrst term in the following equation. The $$+$$ is from Smith paper. It seems to have been a typo in original paper as this version gives the correct solution).\begin {align*} \omega ^{2}-\phi \omega +\left ( \frac {1}{2}\phi ^{\prime }+\frac {1}{2}\phi ^{2}-r\right ) & =0\\ \omega ^{2}-\frac {1}{2x}\omega -\frac {1}{8x^{2}}-\frac {1}{16x^{2}}\left ( 16x-3\right ) & =0 \end {align*}

Solving (and picking ﬁrst root) gives $\omega =\frac {1}{4x}\left ( 1+4\sqrt {x}\right )$ Before using this, we verify it satisﬁes $$\omega ^{\prime }+\omega ^{2}=r$$\begin {align*} \frac {d}{dx}\left ( \frac {1}{4x}\left ( 1+4\sqrt {x}\right ) \right ) +\left ( \frac {1}{4x}\left ( 1+4\sqrt {x}\right ) \right ) ^{2} & =\frac {16x-3}{16x^{2}}\\ \frac {1}{16x^{2}}\left ( 16x-3\right ) & =\frac {16x-3}{16x^{2}} \end {align*}

Veriﬁed OK. Hence solution is \begin {align*} z & =e^{\int \omega dx}\\ & =x^{\frac {1}{4}}e^{2\sqrt {x}} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y_{1} & =ze^{\frac {-1}{2}\int adx}\\ & =x^{\frac {1}{4}}e^{2\sqrt {x}}e^{-\frac {1}{2}\int -\frac {1}{2x}dx}\\ & =\sqrt {x}e^{2\sqrt {x}} \end {align*}

Second solution $$y_{2}$$ can now be ﬁnd by reduction of order.

##### 4.1.10 Example 10 case two

Solve \begin {align} \left ( x^{2}+2\right ) y^{\prime \prime }+3xy^{\prime }-y & =0\tag {1}\\ y^{\prime \prime }+\frac {3x}{\left ( x^{2}+2\right ) }y^{\prime }-\frac {1}{\left ( x^{2}+2\right ) }y & =0\nonumber \\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

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

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( \frac {3x}{\left ( x^{2}+2\right ) }\right ) ^{2}+\frac {1}{2}\frac {d}{dx}\left ( \frac {3x}{\left ( x^{2}+2\right ) }\right ) +\frac {1}{\left ( x^{2}+2\right ) }\nonumber \\ & =\frac {7x^{2}+20}{4\left ( x^{2}+2\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {7x^{2}+20}{4\left ( x^{2}+2\right ) ^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =7x^{2}+20\\ t & =4\left ( x^{2}+2\right ) ^{2}=16+16x^{2}+4x^{4} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,\left ( x^{2}+2\right ) \right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =\left ( x^{2}+2\right ) \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =4-2\\ & =2 \end {align*}

There is pole $$x=\pm i\sqrt {2}$$ of order 2. Looking at the cases table, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that all cases are possible. Hence $$L=\left [ 1,2,4,6,12\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =2,t=4\left ( x^{2}+2\right ) ^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 2,2\right ) -4-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 2-4\right ) \\ & =-\frac {1}{2}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4\left ( x^{2}+2\right ) ^{2}\right ) }{4\left ( x^{2}+2\right ) ^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {x}{x^{2}+2} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}=\left ( x^{2}+2\right )$$. In other words, the number of poles of $$r$$ that are of order $$2$$. There are two poles of order $$2.$$ Hence $$k_{2}=2$$. These poles at $$x=\pm i\sqrt {2}$$. The coeﬃcient of $$\frac {1}{\left ( x-c_{1}\right ) ^{2}}$$ where $$c_{1}$$ is ﬁrst pole is $$b_{1}=-\frac {3}{16}$$. Hence $$e_{1}=\sqrt {1+4b}=\sqrt {1+4\left ( -\frac {3}{16}\right ) }=\frac {1}{2}$$ and $$\theta _{1}=\frac {e_{1}}{x-c_{1}}=\frac {1}{2\left ( x-i\sqrt {2}\right ) }$$. The coeﬃcient of $$\frac {1}{\left ( x-c_{2}\right ) ^{2}}$$ where $$c_{2}$$ is second pole is $$b_{2}=-\frac {3}{16}$$. Hence $$e_{2}=\sqrt {1+4b}=\sqrt {1+4\left ( -\frac {3}{16}\right ) }=\frac {1}{2}$$ and $$\theta _{2}=\frac {e_{1}}{x-c_{2}}=\frac {1}{2\left ( x+i\sqrt {2}\right ) }$$ Hence\begin {align*} e & =\left \{ \frac {1}{2},\frac {1}{2}\right \} \\ \theta & =\left \{ \frac {1}{2\left ( x-i\sqrt {2}\right ) },\frac {1}{2\left ( x+i\sqrt {2}\right ) }\right \} \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8$$ if any exist. Since only order 2 pole exist, then this is skipped. Hence $$k_{2}$$ stays $$2$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. Since this is case $$O\left ( \infty \right ) =2$$, then $$e_{0}=\sqrt {1+4b}$$ where $$b=\frac {lcoeff\left ( s\right ) }{lcoeff\left ( t\right ) }$$ where $$\,lcoeff\left ( s\right )$$ is leading coeﬃcient of $$s=7x^{2}+20$$ which is $$7$$ and $$lcoeff\left ( t\right )$$ is leading coeﬃcient of $$t=16+16x^{2}+4x^{4}$$ which is $$4$$.  Hence $$b=\frac {7}{4}$$. Therefore \begin {align*} e_{0} & =\sqrt {1+4b}=\sqrt {1+4\left ( \frac {7}{4}\right ) }=2\sqrt {2}\\ \theta _{0} & =0 \end {align*}

Hence now we have\begin {align*} e & =\left \{ 2\sqrt {2},\frac {1}{2},\frac {1}{2}\right \} \\ \theta & =\left \{ 0,\frac {1}{2\left ( x-i\sqrt {2}\right ) },\frac {1}{2\left ( x+i\sqrt {2}\right ) }\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$k_{2}=2$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=2^{3}=8$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=2$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1}-s_{2}e_{2} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{2},\theta _{fixed}=\frac {x}{x^{2}+2}$$ gives\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 2\sqrt {2}\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {1}{2}\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {1}{2}\right ) \\ & =-\sqrt {2} \end {align*}

Since not an integer, we try next set $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {+1}{2}\right \}$$ and now Eq (7) gives\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( 2\sqrt {2}\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {1}{2}\right ) -\left ( \frac {+1}{2}\right ) \left ( \frac {1}{2}\right ) \\ & =-\sqrt {2}-\frac {1}{2} \end {align*}

Since not an integer, we try next set $$s=\left \{ \frac {-1}{2},\frac {+1}{2},\frac {-1}{2}\right \}$$. If we continue this way we will ﬁnd that all sets $$s$$ will fail to generate a $$d\geq 0$$. Hence case one did not work. Now we go to case 2 $$\left ( n=2\right )$$.

Starting with $$n=2$$. And since we have $$k_{2}=2$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=3^{3}$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2},\frac {-n}{2}\right \} =\left \{ -1,-1,-1\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=2$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1}-s_{2}e_{2} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{2},\theta _{fixed}=\frac {x}{x^{2}+2}$$ gives\begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{2}\right ) +\left ( -1\right ) \left ( 2\sqrt {2}\right ) -\left ( -1\right ) \left ( \frac {1}{2}\right ) -\left ( -1\right ) \left ( \frac {1}{2}\right ) \\ & =-2\sqrt {2} \end {align*}

Since not an integer, we try next set $$s=\left \{ -1,-1,+1\right \}$$. If we continue this way we will ﬁnd that set $$s=\left \{ 0,-1,-1\right \}$$ works. \begin {align*} d & =\left ( 2\right ) \left ( -\frac {1}{2}\right ) +\left ( 0\right ) \left ( 2\sqrt {2}\right ) -\left ( -1\right ) \left ( \frac {1}{2}\right ) -\left ( -1\right ) \left ( \frac {1}{2}\right ) \\ & =0 \end {align*}

We can use this $$d.\$$From Eq (8)\begin {align*} \Theta & =\left ( 2\right ) \left ( \frac {1}{2x}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}+s_{2}\theta _{2}\\ & =\left ( 2\right ) \left ( \frac {x}{x^{2}+2}\right ) \left ( 0\right ) \left ( 0\right ) -\left ( -1\right ) \left ( \frac {1}{2\left ( x-i\sqrt {2}\right ) }\right ) -\left ( -1\right ) \left ( \frac {1}{2\left ( x+i\sqrt {2}\right ) }\right ) \\ & =\frac {x}{x^{2}+2} \end {align*}

Since this is case 2 ($$n=2$$) then we need to ﬁrst ﬁnd $$P\left ( x\right )$$. The degree is $$d=0$$. Hence constant. Say $$P=1$$. But we need to verify this is valid. Setting up the equation$P^{\prime \prime \prime }+3\Theta P^{\prime \prime }+\left ( 3\Theta ^{2}+3\Theta ^{\prime }-4r\right ) P^{\prime }+\left ( \Theta ^{\prime \prime }+3\Theta \Theta ^{\prime }+\Theta ^{3}-4r\Theta -2r^{\prime }\right ) P=0$ Which simpliﬁes to (since $$P=1$$)$\Theta ^{\prime \prime }+3\Theta \Theta ^{\prime }+\Theta ^{3}-4r\Theta -2r^{\prime }=0$ Using $$\Theta =\frac {x}{x^{2}+2},r=\frac {7x^{2}+20}{4\left ( x^{2}+2\right ) ^{2}}$$ the above reduces to $0=0$ Hence $$P\left ( x\right ) =1$$ can be used. Now let \begin {align*} \phi & =\Theta +\frac {P^{\prime }}{P}\\ & =\frac {x}{x^{2}+2} \end {align*}

We now need to solve for $$\omega$$ from (notice that original Kovacic paper has $$+$$ and not $$-$$ after ﬁrst term in the following equation. The $$+$$ is from Smith paper. It seems to have been a typo in original paper as this version gives the correct solution).\begin {align*} \omega ^{2}-\phi \omega +\left ( \frac {1}{2}\phi ^{\prime }+\frac {1}{2}\phi ^{2}-r\right ) & =0\\ \omega ^{2}-\left ( \frac {x}{x^{2}+2}\right ) +\omega \left ( \frac {1}{2}\left ( \frac {x}{x^{2}+2}\right ) ^{\prime }+\frac {1}{2}\left ( \frac {x}{x^{2}+2}\right ) ^{2}-\frac {7x^{2}+20}{4\left ( x^{2}+2\right ) ^{2}}\right ) & =0\\ \frac {4\omega ^{2}x^{4}-4\omega x^{3}+\left ( 16\omega ^{2}-7\right ) x^{2}-8x\omega +16\omega ^{2}-16}{4\left ( x^{2}+2\right ) ^{2}} & =0\\ 4\omega ^{2}x^{4}-4\omega x^{3}+\left ( 16\omega ^{2}-7\right ) x^{2}-8x\omega +16\omega ^{2}-16 & =0 \end {align*}

Solving for $$\omega$$ (and picking ﬁrst root) gives $\omega =\frac {x+2\sqrt {2x^{2}+4}}{2\left ( x^{2}+2\right ) }$ Before using this, we verify it satisﬁes $$\omega ^{\prime }+\omega ^{2}=r$$\begin {align*} \frac {d}{dx}\left ( \frac {x+2\sqrt {2x^{2}+4}}{2\left ( x^{2}+2\right ) }\right ) +\left ( \frac {x+2\sqrt {2x^{2}+4}}{2\left ( x^{2}+2\right ) }\right ) ^{2} & =\frac {7x^{2}+20}{4\left ( x^{2}+2\right ) ^{2}}\\ \frac {7x^{2}+20}{4x^{4}+16x^{2}+16} & =\frac {7x^{2}+20}{4\left ( x^{2}+2\right ) ^{2}} \end {align*}

Veriﬁed OK. Hence solution is \begin {align*} z & =e^{\int \omega dx}\\ & =e^{\int \frac {x+2\sqrt {2x^{2}+4}}{2\left ( x^{2}+2\right ) }dx}\\ & =\left ( x^{2}+2\right ) ^{\frac {1}{4}}e^{\sqrt {2}\operatorname {arcsinh}\left ( \frac {\sqrt {2}}{2}x\right ) } \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y_{1} & =ze^{\frac {-1}{2}\int adx}\\ & =\left ( x^{2}+2\right ) ^{\frac {1}{4}}e^{\sqrt {2}\operatorname {arcsinh}\left ( \frac {\sqrt {2}}{2}x\right ) }e^{-\frac {1}{2}\int \frac {3x}{\left ( x^{2}+2\right ) }dx}\\ & =\frac {e^{\sqrt {2}\operatorname {arcsinh}\left ( \frac {\sqrt {2}}{2}x\right ) }}{\sqrt {\left ( x^{2}+2\right ) }} \end {align*}

Second solution $$y_{2}$$ can now be ﬁnd by reduction of order.

##### 4.1.11 Example 11 case one

Solve \begin {align} x^{2}\left ( x^{2}+x+1\right ) y^{\prime \prime }-x\left ( -2x^{2}-4x+1\right ) y^{\prime }+y & =0\tag {1}\\ y^{\prime \prime }-\frac {x\left ( -2x^{2}-4x+1\right ) }{x^{2}\left ( x^{2}+x+1\right ) }y^{\prime }+\frac {1}{x^{2}\left ( x^{2}+x+1\right ) }y & =0\nonumber \\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =-\frac {x\left ( -2x^{2}-4x+1\right ) }{x^{2}\left ( x^{2}+x+1\right ) }\\ b & =\frac {1}{x^{2}\left ( x^{2}+x+1\right ) } \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( -\frac {x\left ( -2x^{2}-4x+1\right ) }{x^{2}\left ( x^{2}+x+1\right ) }\right ) ^{2}+\frac {1}{2}\frac {d}{dx}\left ( -\frac {x\left ( -2x^{2}-4x+1\right ) }{x^{2}\left ( x^{2}+x+1\right ) }\right ) -\frac {1}{x^{2}\left ( x^{2}+x+1\right ) }\nonumber \\ & =\frac {10x^{2}-8x-1}{4x^{2}\left ( x^{2}+x+1\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {10x^{2}-8x-1}{4x^{2}\left ( x^{2}+x+1\right ) ^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =10x^{2}-8x-1\\ t & =4x^{2}\left ( x^{2}+x+1\right ) ^{2}\\ & =\left ( x^{3}+x^{2}+x\right ) ^{2} \end {align*}

The free square factorization of $$t$$ is $$t=\left [ 1,x^{3}+x^{2}+x\right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this special case we set\begin {align*} t_{1} & =1\\ t_{2} & =x^{3}+x^{2}+x \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =6-2\\ & =4 \end {align*}

There are poles of order 2. Looking at the cases table, reproduced here

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that all cases are possible. Hence $$L=\left [ 1,2,4,6,12\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =2,t=\left ( x^{3}+x^{2}+x\right ) ^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 6,2\right ) -6-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 2-6\right ) \\ & =-1\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( \left ( x^{3}+x^{2}+x\right ) ^{2}\right ) }{\left ( x^{3}+x^{2}+x\right ) ^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{2}\frac {3x^{2}+2x+1}{x^{3}+x^{2}+x} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}=x^{3}+x^{2}+x$$. In other words, the number of poles of $$r$$ that are of order $$2$$. There are three poles of order $$2.$$ Hence $$k_{2}=3$$. These poles at $$x=\left \{ 0,-\frac {1}{2}\pm \frac {1}{2}i\sqrt {3}\right \}$$. The coeﬃcient of $$\frac {1}{\left ( x-c_{1}\right ) ^{2}}$$ where $$c_{1}$$ is ﬁrst pole is $$b_{1}=-\frac {1}{4}$$. Hence $$e_{1}=\sqrt {1+4b}=\sqrt {1+4\left ( -\frac {1}{4}\right ) }=0$$ and $$\theta _{1}=\frac {e_{1}}{x-c_{1}}=0$$. The coeﬃcient of $$\frac {1}{\left ( x-c_{2}\right ) ^{2}}$$ where $$c_{2}$$ is second pole is $$b_{2}=\frac {9i\sqrt {3}+2}{3\left ( -1+i\sqrt {3}\right ) ^{2}}$$. Hence $$e_{2}=\sqrt {1+4b}=\frac {\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) }$$ and $$\theta _{2}=\frac {e_{2}}{x-c_{2}}=\frac {-2\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) \left ( i\sqrt {3}-2x-1\right ) }$$. The coeﬃcient of $$\frac {1}{\left ( x-c_{3}\right ) ^{2}}$$ where $$c_{3}$$ is the third pole is $$b_{3}=\frac {-9i\sqrt {3}+2}{3\left ( 1+i\sqrt {3}\right ) ^{2}}$$. Hence $$e_{3}=\sqrt {1+4b}=\frac {\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) }$$ and $$\theta _{3}=\frac {e_{3}}{x-c_{3}}=\frac {2\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) \left ( i\sqrt {3}+2x+1\right ) }$$. Hence\begin {align*} e & =\left \{ 0,\frac {\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) },\frac {\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) }\right \} \\ \theta & =\left \{ 0,\frac {-2\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) \left ( i\sqrt {3}-2x-1\right ) },\frac {2\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) \left ( i\sqrt {3}+2x+1\right ) }\right \} \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8$$ if any exist. Since only order 2 pole exist, then this is skipped. Hence $$k_{2}$$ stays $$3$$.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. Since this is case $$O\left ( \infty \right ) =4>2$$ and since there are no poles or order $$4,6,8,\cdots$$ then we do not need to handle case $$n=1$$. Instead we use \begin {align*} e_{0} & =1\\ \theta _{0} & =0 \end {align*}

Hence now we have\begin {align*} e & =\left \{ 1,0,\frac {\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) },\frac {\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) }\right \} \\ \theta & =\left \{ 0,0,\frac {-2\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) \left ( i\sqrt {3}-2x-1\right ) },\frac {2\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) \left ( i\sqrt {3}+2x+1\right ) }\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$k_{2}=3$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=2^{4}=16$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2},\frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=3$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1}-s_{2}e_{2}-s_{3}e_{3} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-1,\theta _{fixed}=\frac {1}{2}\frac {3x^{2}+2x+1}{x^{3}+x^{2}+x}$$ gives\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( +1\right ) -\left ( \frac {-1}{2}\right ) \left ( 0\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) }\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) }\right ) \\ & =-\frac {7}{6}i\sqrt {3}-\frac {3}{2} \end {align*}

Since not an integer, we try next set $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2},\frac {+1}{2}\right \}$$. If we continue this process we will ﬁnd that set $$s=\left \{ \frac {1}{2},\frac {-1}{2},\frac {-1}{2},\frac {+1}{2}\right \}$$ works and generates\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {1}{2}\right ) \left ( +1\right ) -\left ( \frac {-1}{2}\right ) \left ( 0\right ) -\left ( \frac {-1}{2}\right ) \left ( \frac {\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) }\right ) -\left ( \frac {1}{2}\right ) \left ( \frac {\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) }\right ) \\ & =0 \end {align*}

We can use this $$d.\$$From Eq (8)\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}+s_{2}\theta _{2}+s_{3}\theta _{3}\\ & =\left ( 1\right ) \left ( \frac {1}{2}\frac {3x^{2}+2x+1}{x^{3}+x^{2}+x}\right ) +\left ( \frac {-1}{2}\right ) \left ( 0\right ) +\left ( \frac {-1}{2}\right ) \left ( 0\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {-2\sqrt {3}\sqrt {2+30i\sqrt {3}}}{3\left ( -1+i\sqrt {3}\right ) \left ( i\sqrt {3}-2x-1\right ) }\right ) +\left ( \frac {1}{2}\right ) \left ( \frac {2\sqrt {3}\sqrt {2-30i\sqrt {3}}}{3\left ( 1+i\sqrt {3}\right ) \left ( i\sqrt {3}+2x+1\right ) }\right ) \\ & =\frac {1}{2x}\frac {2x^{2}-2x+1}{x^{2}+x+1} \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$P\left ( x\right )$$ if possible.

Step 3

The input to this step is the integer $$d=0$$ and $$\Theta =\frac {1}{2x}\frac {2x^{2}-2x+1}{x^{2}+x+1}$$ found from step 2 and also $$r=\frac {10x^{2}-8x-1}{4x^{2}\left ( x^{2}+x+1\right ) ^{2}}$$. Since degree $$d=0$$, then let $$p\left ( x\right ) =1$$. A constant. We need to verify\begin {align*} P^{\prime \prime }+2\Theta P^{\prime }+\left ( \Theta ^{\prime }+\Theta ^{2}-r\right ) P & =0\\ \Theta ^{\prime }+\Theta ^{2}-r & =0 \end {align*}

Substituting gives\begin {align*} \frac {d}{dx}\left ( \frac {1}{2x}\frac {2x^{2}-2x+1}{x^{2}+x+1}\right ) +\left ( \frac {1}{2x}\frac {2x^{2}-2x+1}{x^{2}+x+1}\right ) ^{2}-\frac {10x^{2}-8x-1}{4x^{2}\left ( x^{2}+x+1\right ) ^{2}} & =0\\ 0 & =0 \end {align*}

Veriﬁed. The solution is\begin {align*} z & =P\left ( x\right ) e^{\int \Theta dx}\\ & =e^{\int \frac {1}{2x}\frac {2x^{2}-2x+1}{x^{2}+x+1}dx}\\ & =\left ( x^{2}+x+1\right ) ^{\frac {1}{4}}\sqrt {x}e^{-\frac {7}{6}\sqrt {3}\arctan \left ( \frac {\left ( 2x+1\right ) \sqrt {3}}{3}\right ) } \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y_{1} & =ze^{\frac {-1}{2}\int adx}\\ & =\left ( x^{2}+x+1\right ) ^{\frac {1}{4}}\sqrt {x}e^{-\frac {7}{6}\sqrt {3}\arctan \left ( \frac {\left ( 2x+1\right ) \sqrt {3}}{3}\right ) }e^{\frac {-1}{2}\int \left ( \frac {1}{x^{2}\left ( x^{2}+x+1\right ) }\right ) dx}\\ & =\frac {xe^{-\frac {7}{3}\sqrt {3}\arctan \left ( \frac {\left ( 2x+1\right ) \sqrt {3}}{3}\right ) }}{\sqrt {x^{2}+x+4}} \end {align*}

Second solution $$y_{2}$$ can now be ﬁnd by reduction of order.

##### 4.1.12 Example 12 case one

Let $\left ( x^{2}-2x\right ) y^{\prime \prime }+\left ( 2-x^{2}\right ) y^{\prime }+\left ( 2x-2\right ) y=0$ Normalizing so that coeﬃcient of $$y^{\prime \prime }$$ is one gives\begin {align} y^{\prime \prime }+\frac {\left ( 2-x^{2}\right ) }{\left ( x^{2}-2x\right ) }y^{\prime }+\frac {\left ( 2x-2\right ) }{\left ( x^{2}-2x\right ) }y & =0\nonumber \\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0 \tag {1} \end {align}

Hence \begin {align*} a & =\frac {\left ( 2-x^{2}\right ) }{\left ( x^{2}-2x\right ) }\\ b & =\frac {\left ( 2x-2\right ) }{\left ( x^{2}-2x\right ) } \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( \frac {\left ( 2-x^{2}\right ) }{\left ( x^{2}-2x\right ) }\right ) ^{2}+\frac {1}{2}\frac {d}{dx}\left ( \frac {\left ( 2-x^{2}\right ) }{\left ( x^{2}-2x\right ) }\right ) -\frac {\left ( 2x-2\right ) }{\left ( x^{2}-2x\right ) }\nonumber \\ & =\frac {x^{4}-8x^{3}+24x^{2}-24x+12}{4x^{2}\left ( x-2\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {x^{4}-8x^{3}+24x^{2}-24x+12}{4x^{2}\left ( x-2\right ) ^{2}}z \tag {5} \end {equation} Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =x^{4}-8x^{3}+24x^{2}-24x+12\\ t & =4x^{2}\left ( x-2\right ) ^{2} \end {align*}

The square free factorization of $$t$$ is $$t=\left [ 1,x\left ( x-2\right ) \right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this case we set\begin {align*} t_{1} & =1\\ t_{2} & =x\left ( x-2\right ) \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =4-4\\ & =0 \end {align*}

There is one pole at $$x=0$$ of order 2 and one pole at $$x=2$$ also of order $$2$$. Looking at the cases table

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 1,2 are possible. $$L=\left [ 1,2\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =0,t=4x^{4},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 0,2\right ) -4-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 0-4\right ) \\ & =-1\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4x^{2}\left ( x-2\right ) ^{2}\right ) }{4x^{2}\left ( x-2\right ) ^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {x^{2}-3x+2}{x\left ( x-2\right ) ^{2}}\\ & =\frac {x-1}{x\left ( x-2\right ) } \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}=x\left ( x-2\right )$$. In other words, the number of poles of $$r$$ that are of order $$2$$. There are two poles. Hence $$k_{2}=2$$. These poles $$c_{i}$$ where $$i=1,2$$ at $$x=\left \{ 0,2\right \}$$. For each $$c_{i}$$ then $$e_{i}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{\left ( x-c_{i}\right ) ^{2}}$$ in the partial fraction expansion of $$r$$ and $$\theta _{i}=\frac {e_{i}}{x-c_{i}}$$. The partial fraction expansion of $$r$$ is\begin {align*} r & =\frac {x^{4}-8x^{3}+24x^{2}-24x+12}{4x^{2}\left ( x-2\right ) ^{2}}\\ & =\frac {1}{4}-\frac {3}{4}\frac {1}{x}-\frac {1}{4}\frac {1}{\left ( x-2\right ) }+\frac {3}{4}\frac {1}{\left ( x-2\right ) ^{2}}+\frac {3}{4}\frac {1}{x^{2}} \end {align*}

The coeﬃcient of $$\frac {1}{\left ( x-0\right ) ^{2}}$$ where $$c_{1}=0$$ is ﬁrst pole is $$b_{1}=\frac {3}{4}$$ from looking at the above. Hence $$e_{1}=\sqrt {1+4b}=\sqrt {1+4\left ( \frac {3}{4}\right ) }=\allowbreak 2$$ and $$\theta _{1}=\frac {e_{1}}{x-c_{1}}=\frac {2}{x}$$. The coeﬃcient of $$\frac {1}{\left ( x-c_{2}\right ) ^{2}}$$ where $$c_{2}=2$$ is second pole is $$b_{2}=\frac {3}{4}$$. Hence $$e_{2}=\sqrt {1+4b}=\sqrt {1+4\left ( \frac {3}{4}\right ) }=2$$ and $$\theta _{2}=\frac {2}{x-c_{2}}=\frac {2}{x-2}$$. Therefore the lists $$e,\theta$$ are\begin {align*} e & =\left \{ 2,2\right \} \\ \theta & =\left \{ \frac {2}{x},\frac {2}{x-2}\right \} \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,k$$ if any exist. There are none. This step is skipped.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since $$O\left ( \infty \right ) =0$$ here then none of these cases applies. For case 1 $$\left ( n=1\right )$$ we ﬁrst ﬁnd $$\left [ r\right ] _{\infty }$$ the sum of terms $$x^{i}$$ for $$i=-\frac {v}{2},\cdots 0$$ where $$v$$ is the $$O\left ( \infty \right )$$ which is zero here. Hence $v=0$ The following is sum of terms from the Laurent series expansion of $$\sqrt {r}$$ at $$x=\infty$$ which is $\left [ \sqrt {r}\right ] _{\infty }=\frac {1}{2}-\frac {1}{x}+\frac {2}{x^{3}}+\frac {11}{x^{4}}+\cdots$ We want only terms for $$0\leq i\leq v$$ but $$v=0$$. Therefore only the constant term. Hence$\left [ \sqrt {r}\right ] _{\infty }=\frac {1}{2}$ Then $$a$$ is the coeﬃcient of $$x^{-\frac {v}{2}}=x^{0}$$ or constant term. Hence $a=\frac {1}{2}$ And $$b$$ is the coeﬃcient of $$x^{\frac {-v}{2}+1}=x$$ in $$r-\left ( \left [ \sqrt {r}\right ] _{\infty }\right ) ^{2}$$. This comes out to be$b=-1$ Hence\begin {align*} e_{0} & =\frac {b}{a}=-2\\ \theta _{0} & =2\left [ \sqrt {r}\right ] _{\infty }=1 \end {align*}

Hence now we have\begin {align*} e & =\left \{ -2,2,2\right \} \\ \theta & =\left \{ 1,\frac {2}{x},\frac {2}{x-2}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$k_{2}=2$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=2^{3}=8$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=2$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1}-s_{2}e_{2} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-1,\theta _{fixed}=\frac {x^{2}-3x+2}{x\left ( x-2\right ) ^{2}}$$ gives\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( -2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) \\ & =2 \end {align*}

This will work. Let us ﬁnd all of the $$d$$ so to compare with the solution to same ode using original kovacic algorithm given earlier to see if we get same $$d^{\prime }s$$. We try next set $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( -2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) \\ & =2 \end {align*}

Trying next set $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {+1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( -2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) \\ & =0 \end {align*}

Trying next set $$s=\left \{ \frac {-1}{2},\frac {+1}{2},\frac {+1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {-1}{2}\right ) \left ( -2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) \\ & =-2 \end {align*}

Trying next set $$s=\left \{ \frac {+1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {+1}{2}\right ) \left ( -2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) \\ & =0 \end {align*}

Trying next set $$s=\left \{ \frac {+1}{2},\frac {-1}{2},\frac {+1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {+1}{2}\right ) \left ( -2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) \\ & =-2 \end {align*}

Trying the next set $$s=\left \{ \frac {+1}{2},\frac {+1}{2},\frac {-1}{2}\right \}$$ \begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {+1}{2}\right ) \left ( -2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) \\ & =-2 \end {align*}

Trying the next set $$s=\left \{ \frac {+1}{2},\frac {+1}{2},\frac {+1}{2}\right \}$$ \begin {align*} d & =\left ( 1\right ) \left ( -1\right ) +\left ( \frac {+1}{2}\right ) \left ( -2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) \\ & =-4 \end {align*}

OK, we have all $$d$$ values. We now try the ones which are $$d\geq 0$$ and these are $$d-0,d=2$$. Trying $$d=2$$ ﬁrst which used the set $$s=\left \{ \frac {-1}{2},\frac {-1}{2},\frac {-1}{2}\right \}$$ gives $$\left \{ 1,\frac {2}{x},\frac {2}{x-2}\right \}$$\begin {align*} \Theta & =\left ( n\right ) \left ( \theta _{fix}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}+s_{21}\theta _{1}\\ & =\left ( 1\right ) \left ( \frac {x^{2}-3x+2}{x\left ( x-2\right ) ^{2}}\right ) +\left ( \frac {-1}{2}\right ) \left ( 1\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {2}{x}\right ) +\left ( \frac {-1}{2}\right ) \left ( \frac {2}{x-2}\right ) \\ & =-\frac {1}{2x}\frac {x^{2}-2}{x-2} \end {align*}

Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$P\left ( x\right )$$ if possible.

Step 3

The input to this step is the integer $$d=0$$ and $$\Theta =-\frac {1}{2x}\frac {x^{2}-2}{x-2}$$ found from step 2 and also $$r=\frac {x^{4}-8x^{3}+24x^{2}-24x+12}{4x^{2}\left ( x-2\right ) ^{2}}$$ which comes from $$z^{\prime \prime }=rz$$.  Since degree $$d=2$$, then let $$p\left ( x\right ) =x^{2}+a_{1}x+a_{2}$$. Solving for $$p\left ( x\right )$$ from$P^{\prime \prime }+2\Theta P^{\prime }+\left ( \Theta ^{\prime }+\Theta ^{2}-r\right ) P=0$ gives $$p\left ( x\right ) =x^{2}$$ as solution. Hence the solution is\begin {align*} z & =P\left ( x\right ) e^{\int \Theta dx}\\ & =x^{2}e^{\int -\frac {1}{2x}\frac {x^{2}-2}{x-2}dx}\\ & =\frac {x^{\frac {3}{2}}}{\sqrt {x-2}}e^{-\frac {x}{2}} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y_{1} & =ze^{\frac {-1}{2}\int adx}\\ & =\frac {x^{\frac {3}{2}}}{\sqrt {x-2}}e^{-\frac {x}{2}}e^{\frac {-1}{2}\int \frac {\left ( 2-x^{2}\right ) }{\left ( x^{2}-2x\right ) }dx}\\ & =x^{2} \end {align*}

The second solution can be found by reduction of order.

##### 4.1.13 Example 13 case one

Let \begin {align} y^{\prime \prime }+\frac {x}{1-x}y^{\prime }-\frac {1}{1-x}y & =0\tag {1}\\ y^{\prime \prime }+ay^{\prime }\left ( x\right ) +by & =0\nonumber \end {align}

Hence \begin {align*} a & =\frac {x}{1-x}\\ b & =-\frac {1}{1-x} \end {align*}

It is ﬁrst transformed to the following ode by eliminating the ﬁrst derivative \begin {equation} z^{\prime \prime }=rz \tag {2} \end {equation} Using what is known as the Liouville transformation given by\begin {equation} y=ze^{\frac {-1}{2}\int adx} \tag {3} \end {equation} Where it can be found that $$r$$ in (2) is given by \begin {align} r & =\frac {1}{4}a^{2}+\frac {1}{2}a^{\prime }-b\nonumber \\ & =\frac {1}{4}\left ( \frac {x}{1-x}\right ) ^{2}+\frac {1}{2}\frac {d}{dx}\left ( \frac {x}{1-x}\right ) -\left ( -\frac {1}{1-x}\right ) \nonumber \\ & =\frac {x^{2}-4x+6}{4\left ( x-1\right ) ^{2}} \tag {4} \end {align}

Hence the DE we will solve using Kovacic algorithm is Eq (2) which is \begin {equation} z^{\prime \prime }=\frac {x^{2}-4x+6}{4\left ( x-1\right ) ^{2}}z \tag {5} \end {equation} Therefore \begin {align} r & =\frac {s}{t}\nonumber \\ & =\frac {x^{2}-4x+6}{4\left ( x-1\right ) ^{2}}\nonumber \end {align}

Step 0 We need to ﬁnd which case it is. $$r=\frac {s}{t}$$ where\begin {align*} s & =x^{2}-4x+6\\ t & =4\left ( x-1\right ) ^{2} \end {align*}

The square free factorization of $$t$$ is $$t=\left [ 1,\left ( x-1\right ) \right ]$$. Hence\begin {equation} m=2 \tag {6} \end {equation} Since $$m$$ is number of elements in the free square factorization. in this case we set\begin {align*} t_{1} & =1\\ t_{2} & =\left ( x-1\right ) \end {align*}

Now \begin {align*} O\left ( \infty \right ) & =\deg \left ( t\right ) -\deg \left ( s\right ) \\ & =2-2\\ & =0 \end {align*}

There is one pole at $$x=1$$ of order 2. Looking at the cases table

 case allowed pole order for $$r=\frac {s}{t}$$ allowed $$O\left ( \infty \right )$$ order $$L$$ 1 $$\left \{ 0,1,2,4,6,8,\cdots \right \}$$ $$\left \{ \cdots ,-8,-6,-4,-2,0,2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 1\right ]$$ 2 $$\left \{ 2,3,5,7,9,\cdots \right \}$$ no condition $$\left [ 2\right ]$$ 3 $$\left \{ 1,2\right \}$$ $$\left \{ 2,3,4,5,6,7,\cdots \right \}$$ $$\left [ 4,6,12\right ]$$

Shows that only case 1,2 are possible. Hence $$L=\left [ 1,2\right ]$$.

Step 1

This step has 4 parts (a,b,c,d).

part (a) Here the ﬁxed parts $$e_{fixed},\theta _{fixed}$$ are calculated using \begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( O\left ( \infty \right ) ,2\right ) -\deg \left ( t\right ) -3\deg \left ( t_{1}\right ) \right ) \\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {t^{\prime }}{t}+3\frac {t_{1}^{\prime }}{t_{1}}\right ) \end {align*}

Using $$O\left ( \infty \right ) =0,t=4\left ( x-1\right ) ^{2},t_{1}=1$$ the above gives\begin {align*} e_{fixed} & =\frac {1}{4}\left ( \min \left ( 0,2\right ) -2-3\left ( 0\right ) \right ) \\ & =\frac {1}{4}\left ( 0-2\right ) \\ & =-\frac {1}{2}\\ \theta _{fixed} & =\frac {1}{4}\left ( \frac {\frac {d}{dx}\left ( 4\left ( x-1\right ) ^{2}\right ) }{4\left ( x-1\right ) ^{2}}+3\left ( 0\right ) \right ) \\ & =\frac {1}{2x-2} \end {align*}

part (b)

Here the values $$e_{i},\theta _{i}$$ are found for $$i=1\cdots k_{2}$$ where $$k_{2}$$ is the number of roots of $$t_{2}=\left ( x-1\right )$$. In other words, the number of poles of $$r$$ that are of order $$2$$. There is one pole of order 2. Hence $$k_{2}=1$$. For each pole $$c_{i}$$ then $$e_{i}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{\left ( x-c_{i}\right ) ^{2}}$$ in the partial fraction expansion of $$r$$ and $$\theta _{i}=\frac {e_{i}}{x-c_{i}}$$. The partial fraction expansion of $$r$$ is$\frac {x^{2}-4x+6}{4\left ( x-1\right ) ^{2}}=\frac {1}{4}+\frac {3}{4\left ( x-1\right ) ^{2}}-\frac {1}{2}\frac {1}{x-1}$ The coeﬃcient of $$\frac {1}{\left ( x-1\right ) ^{2}}$$ is $$b_{1}=\frac {3}{4}$$ from looking at the above. Hence $$e_{1}=\sqrt {1+4b}=\sqrt {1+4\left ( \frac {3}{4}\right ) }=\allowbreak 2$$ and $$\theta _{1}=\frac {e_{1}}{x-c_{1}}=\frac {\allowbreak 2}{x-1}$$.Therefore the lists $$e,\theta$$ are\begin {align*} e & =\left \{ 2\right \} \\ \theta & =\left \{ \frac {2}{x-1}\right \} \end {align*}

Part (c)

This part applied only to case 1. It is used to generate $$e_{i},\theta _{i}$$ for poles of $$r$$ order $$4,6,8,\cdots ,k$$ if any exist. There are none. This step is skipped.

Part(d)

Now we need to ﬁnd $$e_{0},\theta _{0}$$. If $$O\left ( \infty \right ) >2$$ then $$e_{0}=1,\theta _{0}=0$$. But if $$O\left ( \infty \right ) =2$$ then $$\theta _{0}=0$$ and $$e_{0}=\sqrt {1+4b}$$ where $$b$$ is the coeﬃcient of $$\frac {1}{x^{2}}$$ in the Laurent series expansion of $$r$$ at $$\infty$$. Since $$O\left ( \infty \right ) =0$$ here then none of these cases applies. For case 1 $$\left ( n=1\right )$$ we ﬁrst ﬁnd $$\left [ r\right ] _{\infty }$$ the sum of terms $$x^{i}$$ for $$i=-\frac {v}{2},\cdots 0$$ where $$v$$ is $$O\left ( \infty \right )$$ which is zero here. Hence $$v=0$$. This sum of terms is from the Laurent series expansion of $$\sqrt {r}$$ at $$x=\infty$$ which is

$\left [ \sqrt {r}\right ] _{\infty }=\frac {1}{2}-\frac {1}{2x}+\frac {1}{x^{3}}+\cdots$ We want only terms for $$0\leq i\leq v$$ but $$v=0$$. Therefore only the constant term. Hence$\left [ \sqrt {r}\right ] _{\infty }=\frac {1}{2}$ Then $$a$$ is the coeﬃcient of $$x^{-\frac {v}{2}}=x^{0}$$ or constant term. Hence $a=\frac {1}{2}$ And $$b$$ is the coeﬃcient of $$x^{\frac {-v}{2}+1}=x$$ in $$r-\left ( \left [ \sqrt {r}\right ] _{\infty }\right ) ^{2}$$. This comes out to be $b=-\frac {1}{2}$ Therefore\begin {align*} e_{0} & =\frac {b}{a}=\frac {-\frac {1}{2}}{\frac {1}{2}}=-1\\ \theta _{0} & =2\left [ \sqrt {r}\right ] _{\infty }=1 \end {align*}

Hence now we have\begin {align*} e & =\left \{ -1,2\right \} \\ \theta & =\left \{ 1,\frac {2}{x-1}\right \} \end {align*}

The above are arranged such that $$e_{0}$$ is the ﬁrst entry. Same for $$\theta$$. This to keep the same notation as in the paper. The above complete step 1, which is to generates the candidate $$e^{\prime }s$$ and $$\theta ^{\prime }s$$. In step 2, these are used to generate trials $$d$$ and $$\theta$$ and ﬁnd from them $$P\left ( x\right )$$ polynomial if possible.

Step 2

In this step, we now have all the $$e_{i},\theta _{i}$$ values found above in addition to $$e_{fix},\theta _{fix}$$.

Starting with $$n=1$$. And since we have $$k_{2}=1$$ then there are $$\left ( n+1\right ) ^{k_{2}+1}=2^{2}=4$$ sets $$s$$ to try. The ﬁrst set $$s$$ is$s=\left \{ \frac {-n}{2},\frac {-n}{2}\right \} =\left \{ \frac {-1}{2},\frac {-1}{2}\right \}$ Now we generate trial $$d$$ using\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-\sum _{i=1}^{k_{2}}s_{i}e_{i}\nonumber \end {equation} Since $$k_{2}=1$$ then the above becomes\begin {equation} d=\left ( n\right ) \left ( e_{fix}\right ) +s_{0}e_{0}-s_{1}e_{1} \tag {7} \end {equation} If $$d\geq 0$$ then we go and ﬁnd a trial $$\Theta$$. We need to have both $$d,\Theta$$ to go to the next step.  $$\Theta$$ is found using\begin {equation} \Theta =\left ( n\right ) \left ( \theta _{fix}\right ) +\sum _{i=0}^{k_{2}}s_{i}\theta _{i} \tag {8} \end {equation} Hence the ﬁrst trial $$d$$ is (using Eq (7)) and recalling that $$e_{fix}=-\frac {1}{2},\theta _{fixed}=\frac {1}{2x-2}$$ gives using set $$\left \{ \frac {-1}{2},\frac {-1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( -1\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) \\ & =1 \end {align*}

This will work. The corresponding $$\Theta$$ is from (8)\begin {align*} \Theta & =\left ( 1\right ) \left ( \frac {1}{2x-2}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}\\ & =\frac {1}{2x-2}-\frac {1}{2}\left ( 1\right ) -\frac {1}{2}\frac {2}{x-1}\\ & =-\frac {1}{2}\frac {x}{x-1} \end {align*}

Let us ﬁnd all of the $$d$$ and $$\Theta$$ so to compare with the solution to same ode using original kovacic algorithm given earlier to see if we get same $$d^{\prime }s$$. We try next set $$s=\left \{ \frac {-1}{2},\frac {+1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {-1}{2}\right ) \left ( -1\right ) -\left ( \frac {+1}{2}\right ) \left ( 2\right ) \\ & =-1 \end {align*}

We skip this $$d$$ since negative. Next is $$s=\left \{ \frac {+1}{2},\frac {-1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {1}{2}\right ) \left ( -1\right ) -\left ( \frac {-1}{2}\right ) \left ( 2\right ) \\ & =0 \end {align*}

The corresponding $$\Theta$$ is from (8) \begin {align*} \Theta & =\left ( 1\right ) \left ( \frac {1}{2x-2}\right ) +s_{0}\theta _{0}+s_{1}\theta _{1}\\ & =\frac {1}{2x-2}+\frac {1}{2}\left ( 1\right ) -\frac {1}{2}\frac {2}{x-1}\\ & =\frac {x-2}{2\left ( x-1\right ) } \end {align*}

The next set is $$\left \{ \frac {+1}{2},\frac {+1}{2}\right \}$$\begin {align*} d & =\left ( 1\right ) \left ( -\frac {1}{2}\right ) +\left ( \frac {1}{2}\right ) \left ( -1\right ) -\left ( \frac {1}{2}\right ) \left ( \allowbreak 2\right ) \\ & =-2 \end {align*}

OK, we have all $$d$$ values. We now try the ones which are $$d\geq 0$$ and these are $$d=0,d=1$$. Let us use $$d=1$$ case. Now that we have good trial $$d$$ and $$\Theta$$, then step 3 is called to generate $$P\left ( x\right )$$ if possible.

Step 3

The input to this step is the integer $$d=1$$ and $$\Theta =-\frac {1}{2}\frac {x}{x-1}$$ found from step 2 and also $$r=\frac {x^{2}-4x+6}{4\left ( x-1\right ) ^{2}}$$ which comes from $$z^{\prime \prime }=rz$$.  Since degree $$d=1$$, then let $$p\left ( x\right ) =x+a$$. Solving for $$p\left ( x\right )$$ from$P^{\prime \prime }+2\Theta P^{\prime }+\left ( \Theta ^{\prime }+\Theta ^{2}-r\right ) P=0$ gives $$p\left ( x\right ) =x$$ as solution. Hence the solution is\begin {align*} z & =P\left ( x\right ) e^{\int \Theta dx}\\ & =xe^{\int -\frac {1}{2}\frac {x}{x-1}dx}\\ & =x\frac {e^{-\frac {1}{2}x}}{\sqrt {x-1}} \end {align*}

Hence ﬁrst solution to given ODE is\begin {align*} y_{1} & =x\frac {e^{-\frac {1}{2}x}}{\sqrt {x-1}}e^{\frac {-1}{2}\int adx}\\ & =x\frac {e^{-\frac {1}{2}x}}{\sqrt {x-1}}e^{\frac {-1}{2}\int \frac {x}{1-x}dx}\\ & =x \end {align*}

The second solution can be found by reduction of order.