\documentclass[reqno]{amsart}
\usepackage{hyperref}

\AtBeginDocument{{\noindent\small
\emph{Electronic Journal of Differential Equations},
Vol. 2011 (2011), No. 121, pp. 1--16.\newline
ISSN: 1072-6691. URL: http://ejde.math.txstate.edu or http://ejde.math.unt.edu
\newline ftp ejde.math.txstate.edu}
\thanks{\copyright 2011 Texas State University - San Marcos.}
\vspace{9mm}}

\begin{document}
\title[\hfilneg EJDE-2011/121\hfil Computation of rational solutions]
{Computation of rational solutions for a
first-order nonlinear differential equation}

\author[D. Behloul, S. S. Cheng\hfil EJDE-2011/121\hfilneg]
{Djilali Behloul, Sui Sun Cheng}  % in alphabetical order

\address{Djilali Behloul \newline
Facult\'{e} G\'{e}nie Electrique, D\'{e}partement informatique,
USTHB, BP32, El Alia, Bab Ezzouar, 16111, Algiers, Algeria}
\email{dbehloul@yahoo.fr}

\address{Sui Sun Cheng \newline
Department of Mathematics, Hua University, Hsinchu 30043, Taiwan}
\email{sscheng@math.nthu.edu.tw}

\thanks{Submitted August 23, 2011. Published September 19, 2011.}
\thanks{D. Behloul is supported by a national PNR (2011-2013) grant.}
\subjclass[2000]{34A05}
\keywords{Polynomial solution; rational solution;
 nonlinear differential equation}

\begin{abstract}
 In this article, we study  differential equations of
 the form $y'=\sum A_i(x)y^i/\sum B_i(x)y^i$ which
 can be elliptic, hyperbolic, parabolic, Riccati, or quasi-linear.
 We show how rational solutions can be computed in a systematic manner.
 Such results are most likely to find applications in the theory of
 limit cycles as indicated by Gin\'{e} et al \cite{g1}.
\end{abstract}

\maketitle
\numberwithin{equation}{section}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}


\section{Introduction}

When confronting an unfamiliar differential equation, it is natural
to try to find the simplest type of solutions such as polynomial
and rational solutions. Indeed, exact solutions
(such as polynomial and rational solutions) for the nonlinear differential
equation
\begin{equation}
\frac{dy}{dx}=P(x,y)  \label{00}
\end{equation}
are of great interests, in particular understanding the whole set
of solutions and their dynamical properties.
In 1936, Rainville \cite{r1} determined all the Riccati differential
equations of the form
\[
\frac{dy}{dx}=y^{2}+A_1(x)y+A_0(x)
\]
with $A_0$ and $A_1$ polynomials, which have polynomial solutions.
In 1954, Campbell and Golomb \cite{g1} provided an algorithm for finding
all the polynomial solutions of the differential equation
\[
B_0(x)\frac{dy}{dx}=A_2(x)y^{2}+A_1(x)y+A_0(x)
\]
with $B_0$, $A_0$, $A_1$ and $A_2$ polynomials. In 2006, Behloul
and Cheng \cite{b1} (see also \cite{b2}) gave another algorithm
for looking for the rational solutions of the equation
\[
B_0(x)\frac{dy}{dx}=A_n(x)y^n+A_{n-1}(x)y^{n-1}+\dots +A_0(x)
\]
with $B_0$ and $A_i$ polynomials. In 2011, Gin\'{e} et al \cite{g1}
developed new results about `periodic' polynomial solutions for
\begin{equation}
\frac{dy}{dx}=A_n(x)y^n+A_{n-1}(x)y^{n-1}+\dots +A_0(x)
\label{0}
\end{equation}
with $A_i$ polynomials. Such results give rise to sharp
information on the number of polynomial limit cycles. These
conclusions are important since the theory of limit cycles is
an active and difficult research area. For a concise list of
references related to limit cycles of \eqref{0}, including the
works by Abel, Briskin, Gasull, Llibre, Neto, Lloyd, the
readers is referred to \cite{g1}.

Clearly, equations of the form \eqref{0} are among the easiest of
equations of the form \eqref{00}. The next level of difficulty
will come from studying the case when $P(x,y)$ is a rational
function. In this paper, we are concerned with the rational
solutions of the differential equation
\begin{equation}
y'=\frac{A_n(x)y^n+A_{n-1}(x)y^{n-1}+\dots +A_0(x)}{
B_m(x)y^{m}+B_{m-1}(x)y^{m-1}+\dots +B_0(x)},  \label{A}
\end{equation}
where $A_0,A_1,\dots,A_n$ and $B_0,B_1,\dots,B_m$ are (complex
valued) polynomials (of one independent complex variable) such
that $A_n$ and $B_m$ are not identically zero.

By providing a systematic scheme for computing all the rational
solutions of \eqref{A}, we hope that our results lead to
estimates of the number of `rational limit cycles', more general
than those in Gin\'{e} et al \cite{g1}, and to qualitative results
for nonlinear equations of the form \eqref{A} but with an
additional nonlinear perturbations.

As another  motivation for our study, we quote a result by
Malmquist \cite{m1} which states: If the differential equation
\eqref{A} is not one of the two forms
$$
B_0(x)\frac{dy}{dx}=A_1(x)y+A_0(x)$$
 or
$$
B_0(x) \frac{dy}{dx}=A_2(x)y^{2}+A_1(x)y+A_0(x)
$$
then all its one-valued solutions must be \emph{rational}. For
example the equation $\frac{dy}{dx} =y$ admits $e^{x}$ as a
one-valued solution which is not rational and the equation
$\frac{dy}{dx}=1+y^{2}$ admits $\tan x$ as a one-valued solution
which is not rational.

Clearly, equation \eqref{A} is only defined at places where the
denominator does not vanish. However, a root of the denominator
may also be a root of the numerator and  \eqref{A} may
still be meaningful by assigning proper values to the rational
function on the right-hand side. To avoid such technical details,
we will define a polynomial solution to be a polynomial function
$y=y(x)$ such that
\begin{equation}
\begin{split}
&y'(x)\{ B_m(x)y^{m}+B_{m-1}(x)y^{m-1}+\dots +B_0(x)\} \\
&\equiv A_n(x)y^n+A_{n-1}(x)y^{n-1}+\dots +A_0(x);
\end{split} \label{AP}
\end{equation}
and a rational solution to be a pair of polynomials
$(U(x),V(x))$ such that the degree of $V$ is greater than or
equal to $1$ and
\begin{equation}
\begin{split}
&(V(x)U'(x)-U(x)V'(x)) \{ B_m(x)y^{m}+\dots
+B_0(x)t\} \\
&\equiv V^{2}(x)\{ A_n(x)y^n+\dots
+A_0(x)\} .
\end{split} \label{AR}
\end{equation}
Since the right-hand sides and the left-hand sides are polynomials,
singularities are thus avoided.

To motivate what follows, let us  consider the specific example
\begin{equation}
y'=\frac{y^3+2x}{2x^{2}y+x}.  \label{01}
\end{equation}
Suppose we try to find a constant (polynomial) solution of the form
$ y(x)=\lambda $. Then substituting it into the above equation, we
see that
\[
0=0\cdot \{ 2x^{2}\lambda +x\} \equiv \lambda ^3+2x
\]
for all $x$, which is impossible. Next, we try polynomial
solutions with degree  $1$. Then $y''(x)\equiv 0$, such that
\[
0=y''=\big(\frac{y^3+2x}{2x^{2}y+x}\big) '
=\frac{y'(-4x^{2}+4xy^3+3y^{2}) }{x(
2xy+1) ^{2}}-\frac{1}{x^{2}}\frac{y(
4x^{2}+4xy^3+y^{2}) }{(2xy+1) ^{2}}.
\]
Replacing $y'$ by $\frac{y^3+2x}{2x^{2}y+x}$ in the above
equation and rearranging term,
\begin{equation}
\begin{split}
&[ (-4x) y^{5}+(8x^{2}-3) y^{4}+6xy^3+(
1-4x^{2}) y^{2}+(8x^3-6x) y+(4x^{2}) ]y\\
&\equiv -8x^3.
\end{split}  \label{AL}
\end{equation}
Thus $y(x)$ is a factor of the polynomial $x^3$. Hence
$y=\lambda x$ for a nonzero number $\lambda $. Then from
\eqref{01},
\[
\lambda (2x^{2}\lambda +1) \equiv \lambda ^3x^{2}+2,
\]
so that $\lambda =2$. We may easily check that $y(x)=2x$ is indeed
a solution of \eqref{01}.

Next we may try polynomials with higher degrees of course.
But we should stop for a while and consider the existence and
uniqueness of all polynomial and
rational solutions as well as schematic methods for computing them.
To this end, we first settle on a convenient notation. We
will let $\mathbb{N}$ be the set of nonnegative integers,
$\mathbb{N}^{*}$ the set of positive integers, and $\mathbb{C}$
the set of complex numbers. When $G=G(x)$ is a nontrivial
polynomial, its degree is denoted by $\deg G(x)$, and when it is
the zero polynomial, its degree is defined to be $-\infty $. When
$ H=H(x,y)$ is a bivariate polynomial of the form
\[
H(x,y)=h_n(x)y^n+h_{n-1}(x)y^{n-1}+\dots +h_0(x)
\]
where $h_0,\dots,h_n$ are polynomials with $h_n$  not
identically zero, then $\deg _yH(x,y)$ is taken to be $n$
(e.g., if $H(x,y)=3xy^{2}+y$ then $\deg _yH(x,y)=2$, although
$H(0,y)=y$). We will set $a_i=\deg A_i(x)$ for $i=0,1,\dots,n$
and $b_i=\deg B_i(x)$ for $i=0,1,2,\dots,m$,
\begin{gather}
P(x,y)=A_n(x)y^n+A_{n-1}(x)y^{n-1}+\dots +A_0(x),  \label{P}
\\
Q(x,y)=B_m(x)y^{m}+B_{m-1}(x)y^{m-1}+\dots +B_0(x).  \label{Q}
\end{gather}
Let us also write $A_n$ and $B_m$ in the form
\begin{gather*}
A_n(x)=Ax^{a_n}+\dots, \\
B_m(x)=Bx^{b_m}+\dots
\end{gather*}
where $A,B\neq 0$.


The derivative of a function $g(x)$ of one variable is denoted by
$g'(x)$ or $g^{(1)}(x)$ and the higher order derivatives by $
g^{(2)}(x),g^{(3)}(x),\dots$ as usual and partial derivatives of a
function $ H(x,y)$ of two variables are denoted respectively by
$H_x'(x,y)$ and $H_y'(x,y)$.

Let $G=G(x)$ be a polynomial. We recall that the multiplicity of
$G$ at $ \alpha $ is defined to be $0$ if $\alpha $ is not a root
of $G$, and be the positive integer $s$ if $\alpha $ is a root of
$G$ with multiplicity $s$. Let $H=H(x)$ be another polynomial
which is not identically zero. For the rational function
$F(x)=G(x)/H(x)$, if $F$ is not identically zero, its valuation
$v_{\alpha }(F)$ at $\alpha $ is the difference of the
multiplicity of $F$ at $\alpha $ and the multiplicity of $G$ at
$\alpha $; otherwise, its valuation is $+\infty $. For example, if
$F(x)=x(x+1)/( x^3-2x^{2})$, then $v_0(F)=1-2=-1$,
$v_{-1}(F)=1-0=1$, $v_2(F)=0-1=-1$ and $v_{\alpha }(F)=0$ if
$\alpha \notin \{-1,0,2\}$.

In the rest of our discussions, we will  assume that
$P$ and $Q$ are coprime; i.e., $\gcd (P,Q)=1$.
Since $n,m\in \mathbb{N}$, we may classify \eqref{A} into five
mutually distinct and exhaustive cases:

Case I: If $n>m+2$, then \eqref{A} is said to be
\textit{elliptic}.

Case II: If $n<m+2$ and $m\neq 0$, then \eqref{A} is said\textit{\
to be hyperbolic}.

Case III: If $n=m+2$ and $m\neq 0$, then \eqref{A} is said to be\
\textit{ parabolic.}

Case IV: If $(n,m)=(2,0)$, then \eqref{A} is said to be Riccati.

Case V: If $(n,m)=(0,0)$ or $(1,0)$, then \eqref{A} is said to be
quasi-linear.
\smallskip


We intend to show the following results:

\begin{itemize}
\item If \eqref{A} is not quasi-linear, then it has a finite number of
polynomial solutions, and they can be computed in a systematic manner.

\item If \eqref{A} is neither quasi-linear nor Riccati, then it has a finite
number of rational solutions.

\item If \eqref{A} is hyperbolic or elliptic, then all its rational
solutions can be generated by polynomial solutions of another differential
equation of the same form.

\item If \eqref{A} is parabolic, we can compute all the rational solutions
of \eqref{A} provided we have at least one particular rational
solution.

\item If \eqref{A} is quasi-linear, then we can compute all its polynomial
and rational solutions in a systematic manner, although the number of
polynomial or rational solutions may be infinite.

\item If \eqref{A} is Riccati, we can compute all its rational solutions
provided we have at least one particular rational solution, although the
number of rational solutions may be infinite.
\end{itemize}

\section{Polynomial solutions}

It is easy to determine the set of all constant polynomial
solutions of \eqref {A}. We simply substitute $y(z)=\lambda $
into \eqref{A} to obtain
\[
A_n(x)\lambda ^n+A_{n-1}(x)\lambda ^{n-1}+\dots +A_0(x)\equiv
0.
\]
By expanding the left-hand side into a polynomial in $x$, and then
comparing coefficients on both sides of the resulting equation, we
may then obtain a finite system of polynomial equations in
$\lambda$:
\[
H_i(\lambda )=0,\quad i=1,2,\dots,a=\max \{a_0,a_1,\dots,a_n\} .
\]
If an $H_i$ is a nonzero constant polynomial, then $\lambda $
cannot exist. Else, we may let $H$ be the greatest common divisor
of $ H_0,H_1,\dots,H_a$. Then $\lambda $ equals to one of the
roots of $H$.

Next, we seek nonconstant polynomial solutions. First note that if
$y=y(x)$ is a polynomial solution of \eqref{AP} with degree $d\geq
1$, then $\deg (A_iy^i)=a_i+id$ for $i=0,1,\dots,n$, $\deg
(B_iy^iy')=b_i+id+(d-1)$ for $i=0,1,\dots,m$. This motivates
us to define $n+m+1$ indices $f_0(d),f_1(d),\dots,f_{n+m+1}(d)$ by
\begin{gather*}
f_i(d)=a_i+id,\quad i=0,\dots,n; \\
f_{i+n+1}(d)=b_i+id+d-1,\mathit{\ }i=0,\dots,m.
\end{gather*}
We will also let
\[
f(d)=\max \{ f_0(d),f_1(d),\dots,f_{n+m+2}(d)\}
,\quad d=1,2,\dots\,.
\]


\begin{lemma} \label{lem1}
 If $y=y(x)$ is a polynomial solution of \eqref{AP} with
degree $ d\geq 1$, then there exists $i,j\in \{0,1,\dots,n+m+1\}$
such that $i<j$ and
\[
f_i(d)=f_{j}(d)=f(d).
\]
\end{lemma}

\begin{proof}
 Let
\begin{equation}
y(x)=y_dx^{d}+y_{d-1}x^{d-1}+\dots +y_1x+y_0,\,y_d\neq 0,
\label{A'}
\end{equation}
be a polynomial solution of \eqref{A} with degree $d\geq 1$. Then
$\deg (A_iy^i)=f_i(d)$ for $i=0,1,\dots,n$, and
$\deg (B_iy^iy')=f_{i+n+1}$ for $i=0,1,\dots,m$.
Let $i$ be the least nonnegative integer such that $f_i(d)=f(d)$.
By substituting $y$ into \eqref{AP}, we see that
\[
B_m(x)y'(x)y^{m}(x)+\dots +B_0(x)y'(x)\equiv
A_n(x)y^n(x)+\dots +A_0(x).
\]
Suppose $f_{j}(d)<f_i(d)$ for all $j\neq i$. If $i\in
\{0,1,\dots,n\}$, then by rearranging the above identity, we see
that
\[
Qx^{f_i(d)}+W(x)\equiv 0
\]
where $W(x)$ is a polynomial of degree strictly less than
$f_i(d)$, and $Q$ is the product of $y_d^i$ and the leading
coefficient of the polynomial $ A_i$. This is impossible since
$y_d$ and the leading coefficient of $ A_i$ are nonzero. If
$i=n+t+1\in \{n+1,\dots,n+m+1\}$, then by rearranging the above
identity, we see that
\[
\bar{Q}x^{f_i(d)}+\bar{W}(x)\equiv 0
\]
where $\bar{W}(x)$ is a polynomial of degree strictly less than
$f_i(d)$, and $\bar{Q}$ is the product of $dy_dy_d^{t}$ and
the leading coefficient of the polynomial $B_{t}$. Again, this is
impossible. The proof is complete.
\end{proof}


In view of Lemma \ref{lem1}, we may say that a positive integer $d$ is
feasible if $ f(d)$ is attained by two of the indices
$f_0(d),f_1(d),\dots,f_{n+m+1}(d)$. Let us denote the set of
feasible integers by $\Omega $.


\begin{lemma} \label{lem2}
 The set $\Omega $ of feasible integers is bounded from above.
\end{lemma}

\begin{proof}
 There are several cases. First suppose $n>m+1$. Then for
all sufficiently large $d$, $nd+a_n>md+b_m+d-1$ and
\begin{align*}
&f(d)\\
&= \max\big\{
a_0,a_1+d,\dots,a_n+nd;b_0+d-1,b_1+d+d-1,\dots, b_m+md+d-1\big\} \\
&= \max \{ a_n+nd,b_m+md-1\} \\
&= \max \{ a_n+nd\} \\
&= f_n(d) \\
&>\max \{
f_0(d),f_1(d),\dots,f_{n-1}(d);f_{n+1}(d),\dots,f_{n+m+1}(d)\}.
\end{align*}
Thus we may let $d_0$ be the first positive integer such that the
above chain of inequalities hold for all $d\geq d_0$. If $t$ is
feasible, then by Lemma \ref{lem1}, $t<d_0$.

Suppose $n<m+1$. Then for all sufficiently large $d$,
$nd+a_n<md+b_m+d-1$ and
\begin{equation}
f(d)=f_{n+m+1}(d)>\max \{
f_0(d),f_1(d),\dots,f_{n+m}(d)\} \label{c1}
\end{equation}
for sufficiently large $d$. Let $d_0$ be the first positive
integer such that the above chain of inequalities hold for all
$d\geq d_0$. If $t$ is feasible, then by Lemma \ref{lem1}, $t<d_0$.

Suppose $n=m+1$ and $a_n>b_m-1$. Then $nd+a_n>md+b_m+d-1$
for all $ d, $ and for all sufficiently large $d$,
\[
f(d)=f_n(d)>\max \{
f_0(d),f_1(d),\dots,f_{n-1}(d);f_{n+1}(d),\dots,f_{n+m+1}(d)\}.
\]
As in the first case, we let $d_0$ be the first positive integer
such that the above chain of inequalities hold for all $d\geq
d_0$. If $t$ is feasible, then by Lemma \ref{lem1}, $t<d_0$.

Suppose $n=m+1$ and $a_n<b_m-1$. Then $nd+a_n<md+b_m+d-1$
for all $d, $ and for all sufficiently large $d$, \eqref{c1}
holds. By letting $d_0$ be the first positive integer such that
the above chain of inequalities hold for all $d\geq d_0$, we see
that a feasible integer $t$ satisfies $t<d_0. $

Finally, suppose $n=m+1$ and $a_n=b_m-1$. If $y(x)$ defined by
\eqref{A'}  is a solution, then the leading coefficient $y_d$
satisfies the equation $By_d^{m}dy_d=Ay_d^n$. Thus
$y_d=0$ or $Bd=A$. The former case is not possible, and
therefore $A/B=d$. In other words, $d$ is feasible only if
$d=A/B$. The proof is complete.
\end{proof}


\begin{lemma} \label{lem3}
 Let $y=y(x)$ be a polynomial solution of \eqref{A}. Then
for each $ k\in \mathbb{N}^{*}$, we have
\[
y^{(k)}(x)=\frac{P_k(x,y(x))}{(B_my^{m}(x)+\dots
+B_0)^{r_k}},
\]
where each $P_k$ is a bivariate polynomial, $P_1=P$ and
$r_k\in \mathbb{N}. $If \eqref{A} is not quasi-linear, then
$P_k(x,y)$ is not identically zero for each $k$.
\end{lemma}

\begin{proof}
There are several cases.

\textbf{Case 1:} Equation \eqref{A} is
quasi-linear. Then either
\[
y'=\frac{A_0(x)}{B_0(x)}, \quad\text{or}\quad
y'=\frac{A_1(x)y+A_0(x)}{B_0(x)}.
\]
In either cases, we may easily find $y^{(k)}$ by induction and
show that it is not necessarily of the required form, i.e.
$P_k(x,y(x))\equiv 0$. (For example, from the equation $xy'=y$
one has $y'+xy''=y'$, so that $xy''=0.$)

\textbf{Case 2:} Equation \eqref{A} has the form
\[
B_0y'=A_ny^n+\dots +A_0,\quad n\geq 2,\;B_0\neq 0
\]
and $A_n\neq 0$. Then
\[
B_0^{k}y^{(k)}=\alpha _kA_n^{k}y^{k(n-1)+1}+R_k(x,y),
\]
where $\deg _yR_k<k(n-1)+1$ and  $\alpha
_k=\prod_{i=0}^{k-1}(i(n-1)+1)$.

The proof is by induction on $k$. For $k=1$,
\[
B_0y'=\alpha _1A_ny^n+R_1(x,y),
\]
where $R_1(x,y)=A_{n-1}y^{n-1}+\dots +A_0$ and $\alpha _1=1$. Let
us suppose our assertion is true for $k$; i.e.,
\[
B_0^{k}y^{(k)}=\alpha _kA_n^{k}y^{k(n-1)+1}+R_k(x,y),\quad
\deg _yR_k<k(n-1)+1.
\]
By differentiating the two members with respect to $x$, we obtain
\[
kB_0'B_0^{k-1}y^{(k)}+B_0^{k}y^{(k+1)}=(kn-k+1)\alpha
_ky'y^{kn-k}+\frac{d}{dx}(R_k(x,y))
\]
while multiplying by $B_0$,
\[
kB_0'B_0^{k}y^{(k)}+B_0^{k+1}y^{(k+1)}=\alpha
_{k+1}B_0y'y^{kn-k}+B_0\frac{d}{dx}(R_k(x,y)).
\]
Using the induction hypothesis and \eqref{A},
\begin{align*}
&kB_0'\alpha
_k(A_n^{k}y^{k(n-1)+1}+R_k(x,y))+B_0^{k+1}y^{(k+1)}\\
&=\alpha _{k+1}(A_ny^n+\dots +A_0)y^{kn-k}+B_0\frac{d}{dx}(R_k(x,y)).
\end{align*}
It follows that
\[
B_0^{k+1}y^{(k+1)}=\alpha
_{k+1}A_n^{k+1}y^{kn+n-k}+R_{k+1}(x,y),
\]
where
\begin{align*}
R_{k+1}(x,y) &= B_0\frac{d}{dx}(R_k(x,y))+\alpha
_{k+1}(A_{n-1}y^{kn+n-k-1}+\dots +A_0y^{kn-k}) \\
&\quad-kB_0'(\alpha _ky^{kn-k+1}+R_k(x,y)).
\end{align*}
We may now conclude that
\[
\deg _y(R_{k+1}(x,y))<kn+n-k.
\]

\textbf{Case 3:} Equation \eqref{A} has the form $y'=P(x,y)/Q(x,y)$
where $\gcd (P,Q)=1 $and $\deg _yQ\geq 1$. We can write
$ y'=P/R^{s}U$, where $Q=R^{s}U$, $R$ is irreducible,
$\deg _yR\geq 1$, $\gcd (R,U)=1$ and $s\in
\mathbb{N}^{*}$. We will prove (by induction) that for
all $k\in \mathbb{N}$, one has
\begin{equation}
y^{(k)}=\frac{P_k}{R^{t_k}U^{r_k}}\quad\text{and}\quad
\gcd (R,P_k)=1 \label{k}
\end{equation}
where $t_k\in \mathbb{N}^{*}$ and $r_k\in \mathbb{N}^{*}$.
Then, since $ \gcd (R,P_k)=1$, $P_k(x,y)$ is not identically
zero for all $k$.

Now, for $k=0$ , since $R$ is irreducible and $\gcd (P,Q)=1$, we
see that $ \gcd (R,P)=1$. We take $P_0=P$, $t_0=s$ and $r_0=1$.
Then the result is true for $k=0$.

Let us suppose that our result is true for the order $k$, i.e.,
\[
y^{(k)}=\frac{P_k}{R^{t_k}U^{r_k}}\text{ and }\gcd
(R,P_k)=1
\]
where $t_k\in \mathbb{N}^{*}$ and $r_k\in \mathbb{N}^{*}$. By
differentiating both sides with respect to $x$, and replacing $y'$
by $P/R^{s}U$, we have
\begin{align*}
y^{(k+1)}
&= \Big(((P_k)_y'RU-t_kP_kR_y'U+r_kP_kRU_y')P\\
&\quad +R^{s}U((P_k)_x'RU-t_kP_kR_x'U+r_kP_kRU_x')
\Big)\big/(R^{t_k+1+s}U^{r_k+2}) \\
&\equiv \frac{P_{k+1}}{R^{t_{k+1}}U^{r_{k+1}}}.
\end{align*}
It remains to prove that $\gcd (R,P_{k+1})=1$. We have
\begin{align*}
P_{k+1} &= ((P_k)_y'RU-t_kP_kR_y'U+r_kP_kRU_y')P\\
&\quad +R^{s}U((P_k)_x'RU-t_kP_kR_x'U+r_kP_kRU_x') \\
&= \big\{((P_k)_y'U+r_kP_kU_y')P+R^{s-1}U((P_k)_x'RU
-t_kP_kR_x'U+r_kP_kRU_x')\big\}R\\
&\quad -t_kP_kR_y'UP.
\end{align*}
Let
\[
T=((P_k)_y'U+r_kP_kU_y')P+R^{s-1}U((P_k)_x'RU-t_kP_kR_x'U+r_kP_kRU_x')
\]
which is a bivariate polynomial $T(x,y)$, and
$W=-t_kP_kR_y'UP $ which is also a bivariate polynomial
$W(x,y)$. Then we may write
\[
P_{k+1}=TR+W.
\]

First $\gcd (R,W)=1$, because $\gcd (R,P_k)=1$ is the induction
hypothesis, then $\gcd (R,R_y')=1$ since $R$ is irreducible, and
$\gcd (R,U)=1$, $ \gcd (R,P)=1$ by definition of $R$ and $U$.

Second $\gcd (R,P_{k+1})=1$, for otherwise if $\gcd
(R,P_{k+1})\neq 1$, then in view of the fact that $R$ is
irreducible, $R$ divides\ $P_{k+1}$. But $ W=P_{k+1}-TR$, thus $R$
divides $W$, which is a contradiction. We may now conclude that
$\gcd (R,P_{k+1})=1$. The proof is complete.
\end{proof}

We are now able to prove the following fundamental theorem.

\begin{theorem} \label{thm1}
 If the differential equation
\eqref{A} is not quasi-linear, then it admits a finite number of
polynomial solutions, and they can be computed in a systematic
manner.
\end{theorem}

\begin{proof}
As explained before, we may easily determine the constant
polynomial solutions of \eqref{A}. Next, by Lemma \ref{lem2}, the set of
feasible integers is bounded above, say, by $\delta $. For each
polynomial $y=y(x)$ of the form ( \ref{A'}) and of degree $d\leq
\delta $, we calculate $P_{d+1}$ in Lemma \ref{lem3}. Then we are led to
the algebraic identity $P_{d+1}(x,y(x))\equiv 0$. This algebraic
equation can be written as $D_{\sigma }y^{\sigma }(x)+\dots
+D_1y(x)\equiv D_0$, where each $D_i$ is a polynomial in $x$,
$\sigma \in \mathbb{N}^{\ast }$, and $D_0$ as well as $D_{\sigma
}$ are not identically zero. Thus the polynomial $y$ is a factor
of $D_0$. Now we may replace all possible factors of $D_0$ into
\eqref{A}, and apply the method of undetermined coefficients to
find $y$. The proof is complete.
\end{proof}

An example will illustrate the above proof.


\begin{example} \label{examp1} \rm
 Consider the equation
\begin{equation}
y'=\frac{y^3+2x}{2x^{2}y+x},  \label{A1}
\end{equation}
where $A_{3}(x)=1$, $A_2(x)=0$, $A_1(x)=0$, $A_0(x)=2x$, $
B_1(x)=2x^{2}$ and $B_0(x)=x$. This equation is not quasi-linear,
we can find all its polynomial solutions. First of all, constant
solutions are not possible since substituting $y=\lambda $ into it
yielding
\[
\lambda ^3+2x\equiv 0,
\]
which is impossible. Next, we may easily see that
\begin{gather*}
f_0(d) = a_0+0\cdot d=1, \\
f_1(d) = a_1+d=0+d=d, \\
f_2(d) = a_2+2d=0+2d=2d, \\
f_{3}(d) = a_{3}+3d=0+3d=3d, \\
f_{4}(d) = b_0+0\cdot d+d-1=d, \\
f_{5}(d) = b_1+d+d-1=1+2d, \\
f(d) = \max \{3d,1+2d\}=3d.
\end{gather*}
Since $1+2d<3d$ for $d>1$, we see further that $\Omega =\{1\}$.
Let $y$ be a polynomial solution of degree $1$. Then as we have
already seen in the Introduction, \eqref{AL} must hold, and $y=2x$
is a polynomial solution and hence is also the unique polynomial
solution of \eqref{A1}.
\end{example}

\section{Rational solutions}

We now turn to rational solutions of \eqref{A}.

\begin{theorem} \label{thm2}
If \eqref{A} is elliptic,
then any rational solution of \eqref{A} is of the form
$y=u/A_n$ where $ u $ is a polynomial; and
if \eqref{A} is hyperbolic or $ (n,m)=(1,0)$, then there
exists $\varrho \in \mathbb{N}$ (which can be
determined) such that any rational solution of \eqref{A} is of the
form $y=u/B_m^{\varrho }$, where $u$ is a
polynomial.
\end{theorem}

Before we turn to the proof, recall from Taylor's expansion that
\begin{gather*}
A_n(x)=A_n(x_0)+\dots +A_n^{(k)}(x_0)\frac{(x-x_0)^{k}}{k!}
+\dots +A_n^{(a_n)}(x_0)\frac{(x-x_0)^{a_n}}{a_n!},
\\
B_m(x)=B_m(x_0)+\dots +B_m^{(k)}(x_0)\frac{(x-x_0)^{k}}{k!}
+\dots +B_m^{(b_m)}(x_0)\frac{(x-x_0)^{b_m}}{b_m!}.
\end{gather*}
Furthermore, if $x_0$ is a root of $A_n$ or $B_m$, then we can
write
\begin{gather*}
A_n(x)=A_n^{(\alpha )}(x_0)\frac{(x-x_0)^{\alpha }}{\alpha !}
+\dots
+A_n^{(a_n)}(x_0)\frac{(x-x_0)^{a_n}}{a_n!},\;\alpha
=v_{x_0}(A_n),
\\
B_m(x)=B_m^{(\beta )}(x_0)\frac{(x-x_0)^{\beta }}{\beta
!}+\dots
+B_m^{(b_m)}(x_0)\frac{(x-x_0)^{b_m}}{b_m!},\;\beta
=v_{x_0}(B_m).
\end{gather*}


\begin{proof}[Proof of Theorem \ref{thm2}]
First note that if $u$ is a rational
solution of an elliptic equation \eqref{A}, then a pole of $u$ is
a root of $A_n$. Indeed, let $\alpha $ be a pole of $u$ with
order $k>0$. If $A_n(\alpha )$ is not null, then the valuation
of\ $P(x,u)$ (as a function of $x$) at $ \alpha $ is exactly $-nk$
and the valuation of $Q(x,y)y'$ (as a function of $x$) at $\alpha
$ is at least $-mk-k-1$. Since $n>m+2$, the equality
$Q(x,u)u'=P(x,u)$ is then impossible.

Now let $y$ be a rational solution of \eqref{A}. Then it can be
written as $ u/A_n$ where $u$ is rational. From \eqref{A}, we
have
\[
\big(B_m(\frac{u}{A_n}) ^{m}+\dots +B_0\big)
\big(\frac{u'A_n-uA_n'}{A_n^{2}}\big)
=A_n(\frac{u}{A_n}) ^n+\dots +A_1\frac{u}{A_n}+A_0.
\]
But $n-1\geq m+2$, thus
\[
(A_n^{n-m-3}B_mu^{m}+\dots
+A_n^{n-3}B_0)(u'A_n-uA_n')=u^n+\dots
+A_n^nA_1\frac{u}{A_n} +A_n^{n-1}A_0,
\]
and
\begin{align*}
&(A_n^{n-m-2}B_mu^{m}+\dots +A_n^{n-2}B_0)u'\\
&= u^n+\dots
+(A_n^{n-m-3}B_mu^{m+1}+\dots
+A_n^{n-3}B_0u)A_n'+\dots +A_n^{n-1}A_0,
\end{align*}
so that  \eqref{A} becomes the so called ``reduced
equation''
\begin{equation}
(\tilde{B}_mu^{m}+\dots +\tilde{B}_0)u'=u^n+\tilde{A}
_{n-1}u^{n-1}+\dots +\tilde{A}_0  \label{R}
\end{equation}
where $\tilde{B}_i$, $\tilde{A}_i$ are polynomials and
$\tilde{B}_m$ is not identically zero. Note that \eqref{R} is
also elliptic. Thus by what we have discussed above, a pole
$\alpha $ of $u$ as a solution of \eqref{R} must be a root of the
leading coefficient of the right hand side. But since this
coefficient is $1$, $u$ cannot have any poles. We conclude that
$u$ is a polynomial.

Suppose \eqref{A} is hyperbolic. Let $y$ be a rational function
and $\alpha $ a pole of order $k$ $>0\ $of $y$. If $B_m(\alpha
)$ is not null, then the valuation of\ $Q(x,y)y'$ (as a function
of $x$) at $\alpha $ is exactly $-mk-k-1$ and the valuation of
$P(x,y)$ (as a function of $x$) at $ \alpha $ is at least $-nk$.
Since $n\leq m+1$, the equality $Q(x,y)y'=P(x,y)$ is then
impossible, unless $B_m(\alpha )=0$. We may conclude that any
rational solution of \eqref{A} is of the form $u/B_m^{r} $where
$ u$ is a polynomial and $r\in \mathbb{N}$.

Let $x_0$ a root of $B_m$ of order $v_{x_0}(B_m)\in
\mathbb{N}^{*}$ ,\ and $y$ a rational solution with the pole
$x_0$:
\[
y=\frac{c}{(x-x_0)^{-v_{x_0}(y)}}+R,
\]
where $c\in \mathbf{C\backslash }\{0\}$, $R$ is rational and $
v_{x_0}(R)>v_{x_0}(y)$.

Let us show that there exists $k_{x_0}'\in \mathbb{N}$ (which can
be determined) such that
\[
-v_{x_0}(y)\leq k_{x_0}'.
\]
First there exists a least integer $k_{x_0}\in \mathbb{N}^{\ast }$
which can easily be determined, such that for any integer $k\geq
k_{x_0}$, we have
\[
nk-v_{x_0}(A_n)>ik-v_{x_0}(A_i)
\]
for $i=0,\dots,n-1$, and
\[
mk-v_{x_0}(B_m)+k+1>ik-v_{x_0}(B_i)+k+1
\]
for $i=0,\dots,m-1$. (In practice one uses $
mk-v_{x_0}(B_m)>ik-v_{x_0}(B_i).$)

Next, if $m+1>n$, then $mk-v_{x_0}(B_m)+k+1>nk-v_{x_0}(A_n)$
so that $(m+1-n)k+1>v_{x_0}(B_m)-v_{x_0}(A_n)$ for
sufficiently large $k$.

If $n<m+1$ then $-v_{x_0}(y)\leq k_{x_0}$, and we may take $
k_{x_0}'=k_{x_0}$

If $n=m+1$ and $v_{x_0}(A_n)\neq v_{x_0}(B_m)-1$, then $
-v_{x_0}(y)\leq k_{x_0}$ and we may take $k_{x_0}'=k_{x_0}$

If $n=m+1$ and $v_{x_0}(A_n)=v_{x_0}(B_m)-1$, then we put $
v_{x_0}(A_n)=\alpha $, $v_{x_0}(B_m)=\beta $ and $
v_{x_0}(y)=\gamma $, so that replacing $y$ by $(c(x-x_0)^{\gamma
}+R) $in \eqref{A} and using Taylor's expansion of $A_n$ and
$B_m$ at $x_0$, we have $(B_my^{m}+\dots )y'=A_ny^n+\dots$. Hence
\begin{align*}
&\Big(\big(B_m^{(\beta )}(x_0)\frac{(x-x_0)^{\beta }}{\beta
!} +\dots \big) (c^{m}(x-x_0)^{m\gamma }+\dots )+\dots \Big)
(c\gamma
(x-x_0)^{\gamma -1}+R') \\
&= \big(A_n^{(\alpha )}(x_0)\frac{(x-x_0)^{\alpha }}{\alpha !}
+\dots \big) (c^n(x-x_0)^{n\gamma })+\dots )+\dots
\end{align*}
and
\begin{align*}
&B_m^{(\beta )}(x_0)\frac{(x-x_0)^{\beta }}{\beta !}
c^{m}(x-x_0)^{m\gamma }c\gamma (x-x_0)^{\gamma -1}+\dots\\
&=A_n^{(\alpha )}(x_0)\frac{(x-x_0)^{\alpha }}{\alpha !}
c^n(x-x_0)^{n\gamma }+\dots ,
\end{align*}
so that
\[
\frac{B_m^{(\beta )}(x_0)}{\beta !}c^{m+1}\gamma
(x-x_0)^{m\gamma +\beta +\gamma -1}+\dots =\frac{A_n^{(\alpha
)}(x_0)}{\alpha !} c^n(x-x_0)^{\alpha +n\gamma }+\dots .
\]
But $n=m+1$ and $\alpha =\beta -1$, thus
\[
\frac{B_m^{(\alpha +1)}(x_0)}{(\alpha +1)!}c^n\gamma
(x-x_0)^{\alpha +n\gamma }+\dots =\frac{A_n^{(\alpha
)}(x_0)}{\alpha !}c^n(x-x_0)^{\alpha +n\gamma }+\dots .
\]
Comparing coefficients of $(x-x_0)^{\alpha +n\gamma }$, we see
that
\[
\frac{B_m^{(\alpha +1)}(x_0)}{(\alpha +1)!}c^n\gamma =\frac{
A_n^{(\alpha )}(x_0)}{\alpha !}c^n,
\]
which, in view of $c\neq 0$, implies that
\[
\gamma =(\alpha +1)\frac{A_n^{(\alpha )}(x_0)}{B_m^{(\alpha
+1)}(x_0) }.
\]
If $-\gamma$ is an integer and is greater than $k_{x_0}$, then we
may take $k_{x_0}'=-\gamma $, else we take $k_{x_0}'=k_{x_0}$. Let
us show that $\varrho =\max \{ k_{x_i}':x_i\text{ is a
root of }B_m\} $, where $k_{x_i}'$ are defined as above.

Let $x_0,x_1,\dots,x_{h}$ be the roots of $B_{m}$and $y$ a
rational solution of \eqref{A}. We know that any pole of $y$ is a
root of $ B_m$. Then
\[
y=\frac{p_1(x)}{
(x-x_0)^{-v_{x_0}(y)}(x-x_1)^{-v_{x_1}(y)}\dots(x-x_{h})^{-v_{x_{h}}(y)}
}
\]
where $p_1(x)$ is a polynomial (eventually some $v_{x_i}(y)$ can
be equal to zero). Since $-v_{x_i}(y)\leq k_{x_i}'$ for
$i=1,\dots,h, $ multiplying the last fraction by
\[
\frac{(x-x_0)^{v_{x_0}(y)+k_{x_0}'}(x-x_1)^{v_{x_1}(y)+k_{x_1}'}\dots(x-x_{h})^{v_{x_{h}}+k_{x_{h}}'}}{
(x-x_0)^{v_{x_0}(y)+k_{x_0}'}(x-x_1)^{v_{x_1}(y)+k_{x_1}'}\dots(x-x_{h})^{v_{x_{h}}+k_{x_{h}}'}}\equiv
1,
\]
we obtain
\[
y=\frac{p_2(x)}{(x-x_0)^{k_{x_0}'}(x-x_1)^{k_{x_1}'}\dots(x-x_{h})^{k_{x_{h}}'}}
\]
where $p_2(x)$ is a polynomial.

Multiplying the above fraction by
\[
\frac{(x-x_0)^{\varrho '-k_{x_0}'}(x-x_1)^{\varrho
'-k_{x_1}'}\dots(x-x_{h})^{\varrho '-k_{x_{h}}'}}{(x-x_0)^{\varrho
'-k_{x_0}'}(x-x_1)^{\varrho '-k_{x_1}'}\dots(x-x_{h})^{\varrho
'-k_{x_{h}}'}}\equiv 1
\]
where $\varrho '=\max \{ k_{x_i}'\} $, we obtain
\[
y=\frac{p_{3}(x)}{[(x-x_0)(x-x_1)\dots(x-x_{h})]^{\varrho '}},
\]
where $p_{3}(x)$ is a polynomial. But
\[
B_m(x)=B(x-x_0)^{v_{x_0}(B_m)}(x-x_1)^{v_{x_1}(B_m)}\dots(x-x_{h})^{v_{x_{h}}(B_m)},
\]
if we multiply the last fraction by
\[
\frac{B^{^{\varrho '}}(x-x_0)^{(v_{x_0}(B_m)-1)\varrho
'}(x-x_1)^{(v_{x_1}(B_m)-1)\varrho
'}\dots(x-x_{h})^{(v_{x_{h}}(B_m)-1)\varrho '}}{B^{^{\varrho
'}}(x-x_0)^{(v_{x_0}(B_m)-1)\varrho
'}(x-x_1)^{(v_{x_1}(B_m)-1)\varrho
'}\dots(x-x_{h})^{(v_{x_{h}}(B_m)-1)\varrho '}}\equiv 1,
\]
we obtain
\[
y=\frac{p_{4}(x)}{B_m^{\varrho '}},
\]
where $p_{4}(x)$ is a polynomial. We now take
$\varrho =\varrho '=\max \{ k_{x_i}':x_i\text{ is a root of }B_m\} $.
\end{proof}

We remark that we can also take $\varrho =LCM\{
k_{x_i}':x_i\text{ is a root of }B_m\} $ or any
integer $s$ greater than $ \varrho '$. When multiplying the last
fraction by
\[
\frac{B_m^{s-\varrho '}}{B_m^{s-\varrho '}}\equiv 1,
\]
we obtain
\[
y=\frac{p_{5}(x)}{B_m^{s}},
\]
where $p_{5}(x)$ is a polynomial.


\begin{example} \label{examp2} \rm
 Equation \eqref{A1} is elliptic. Hence any rational
solution is of the form $y(x)=u(x)/A_{3}(x)=u(x)$ for some
polynomial $u$. By Example \ref{examp1}, $y(x)=2x$ is the unique rational
solution of \eqref{A1}.
\end{example}

\begin{example} \label{examp3} \rm
 Consider the equation
\begin{equation}
y'=\frac{xy^{2}+y}{y^3+x}.  \label{A1'}
\end{equation}
which is hyperbolic. Since $B_{3}=1$, its rational solutions are
equal to its polynomial solutions. The only constant polynomial
solution is $y(x)=0$. Furthermore, since $\Omega =\{1\}$, then if
$y(x)$ is a polynomial solution of degree $1$, we obtain from
\eqref{A1'} that
\begin{equation}
y''=y\frac{y^{4}-1}{(y^3+x)
^{2}}+\frac{ y'}{(y^3+x) ^{2}}(
2x^{2}y-xy^{4}+x-2y^3) .  \label{A2'}
\end{equation}
Replacing $y'\ $by $\frac{xy^{2}+y}{y^3+x}\ $ in \eqref{A2'}, we
see that
\begin{equation}
-y^{6}+x^{2}y^{4}+2xy^3+3y^{2}+(-2x^3) y+(
-3x^{2}) =0;  \label{AL'}
\end{equation}
that is,
\[
[ -y^{5}+x^{2}y^3+2xy^{2}+3y+(-2x^3) ]y=3x^{2}.
\]
One concludes that $y$ divides $3x^{2}$. Thus $y=\lambda x$ where
$\lambda $ is some nonzero number. Replacing $y\ $by $\lambda x\
$in \eqref{A1'}, we have
\[
\lambda =\frac{x^{2}\lambda ^{2}+\lambda }{\lambda ^3x^{2}+1}.
\]
Thus $\lambda ^{4}=\lambda ^{2}$ i.e. $\lambda =1,-1$. In
conclusion, $0,x$ \ and $-x$ are all the rational solutions of
\eqref{A1'}.
\end{example}


\begin{example} \label{examp4} \rm
 Consider the equation
\[
y'=\frac{y^3-1}{xy^{2}-1}
\]
which is a hyperbolic equation, we can then compute all its
rational solutions. By Theorem \ref{thm2}, since $x_0=0$ is the only root
of order $1$ of $ B_m(x)=x$, we know that $y=u/x^{\varrho}$
where $u$ is a polynomial and $\varrho $ is determined as in
the proof of Theorem \ref{thm2}. More precisely, let
\[
y=\frac{c}{x^{-v_0(y)}}+R,
\]
where $c\in \mathbb{C}\backslash \{0\}$, $R$ is rational and $
v_0(R)>v_0(y)$.

Let us find $k_0\in \mathbb{N}$ such that for any integer $k\geq
k_0$, we have
\[
3k-v_0(A_{3})>ik-v_0(A_i)
\]
for $i=0,1,2$ and
\[
2k-v_0(B_2)>ik-v_0(B_i)
\]
for $i=0,1$.

Since $A_2=A_1=B_1\equiv 0$, we see that $
v_0(A_2)=v_0(A_1)=v_0(B_1)=+\infty $, and $v_0(A_{3})=0=\alpha $,
$v_0(A_0)=0$, $v_0(B_2)=1=\beta $, $v_0(B_0)=0$. Therefore, it is
clear that $k_0=1$.

Here $n=m+1=3$ and $v_0(A_{3})=v_0(B_2)-1=0$, then put $
v_0(y)=\gamma $, so that replacing $y$ by $(cx^{\gamma }+R) $in
\eqref{A} , as in proof of Theorem \ref{thm2}, we obtain
\[
\gamma =(\alpha +1)\frac{A_n^{(\alpha )}(x_0)}{B_m^{(\alpha
+1)}(x_0) }=1
\]
since $\alpha =0,\ n=3,\ m=2,\ x_0=0,\ A_{3}(0)=1$ and
$B_2^{(1)}(0)=1$. Since $\gamma >0$, one takes $\varrho =k_0=1$.

The reduced equation satisfied by the polynomial $u$ is
\begin{equation}
u'=\frac{2u^3-xu-x^3}{xu^{2}-x^{2}}.  \label{16}
\end{equation}
Here $\Omega =\{1,2\}$. Then $u^{(3)}=0$. By differentiating both
sides of ( \ref{16}), we obtain
\[
u''=\frac{(
2u^{4}-5u^{2}x+2ux^3+x^{2}) u'}{x(x-u^{2})
^{2}}-\frac{(2u^{5}-4u^3x+2u^{2}x^3+ux^{2}-x^{4})
}{x^{2}(x-u^{2}) ^{2}}.
\]
Replacing $u'\ $by  $\frac{2u^3-xu-x^3}{xu^{2}-x^{2}}$, we see
that
\[
u''=\frac{2(
-u^{7}+3u^{5}x-u^3x^{2}-3u^{2}x^{4}+ux^{6}+x^{5})
}{x^{2}(x-u^{2}) ^3}.
\]
By differentiating both sides again, we obtain
\begin{align*}
u^{(3)} &= \frac{(
u^{8}-4u^{6}x+12u^{4}x^{2}-12u^3x^{4}+5u^{2}x^{6}-3u^{2}x^3+x^{7})
u'}{x^{2}(x-u^{2}) ^{4}} \\
&\quad +\frac{2u(
-2u^{8}+8u^{6}x-12u^{4}x^{2}+6u^3x^{4}-4u^{2}x^{6}+3u^{2}x^3+x^{7}
) }{x^3(x-u^{2}) ^{4}}.
\end{align*}
If we replace $u'\ $by  $\frac{2u^3-xu-x^3}{xu^{2}-x^{2}}$ and
$u^{(3)}$ by $0$ in the above equation, we see that
\begin{equation}
\begin{split}
0 &= 2u^{11}-11xu^{9}+x^3u^{8}+12x^{2}u^{7}+8x^{4}u^{6}-(
2x^{6}+12x^3) u^{5}  \notag \\
&\quad +12x^{5}u^{4}+(3x^{4}-19x^{7}) u^3+(
5x^{9}-3x^{6}) u^{2}+3x^{8}u+x^{10}.
\end{split}  \label{AL''}
\end{equation}
We may conclude that $u$ divides $x^{10}$. Thus $y$ is a constant
function or $u=\lambda x$ or $u=\lambda x^{2}$, where
$\lambda \in \mathbb{C} \backslash \{0\}$. It is clear that \eqref{16}
has non-constant solutions only, because replacing $y$ by a constant
$\lambda $ in \eqref{16}, we obtain for all $x\in \mathbb{C}$
that $2\lambda ^3-x\lambda -x^3=0$ which is impossible. If
$u=\lambda x$ then
\[
\lambda =\frac{2(\lambda x)^3-x(\lambda x)-x^3}{x(\lambda
x)^{2}-x^{2}};
\]
i.e., $\lambda ^3=1$. One concludes that $u=x,xe^{\frac{2i\pi
}{3}},xe^{ \frac{4i\pi }{3}}$. If $u=\lambda x^{2}$ then
\[
2\lambda x=\frac{2(\lambda x^{2})^3-x(\lambda
x^{2})-x^3}{x(\lambda x^{2})^{2}-x^{2}};
\]
i.e., $\lambda =1$. One concludes that $u=x^{2}$.
Finally $y=1,e^{\frac{2i\pi}{3}},e^{\frac{4i\pi }{3}}$ or $x$.
\end{example}

\section{The parabolic case}

\begin{theorem} \label{thm3}
Let us consider the differential equation
\begin{equation}
y'=\frac{A_{m+2}y^{m+2}+\dots +A_0}{B_my^{m}+\dots +B_0},
\label{B}
\end{equation}
where $m\in \mathbb{N}^{*}$,
$A_i$, $B_i$  are polynomials such that
$A_{m+2}$ and $B_m$ are not identically
zero, and $A_{m+2}y^{m+2}+\dots +A_0$ and
$B_my^{m}+\dots +B_0$ are coprime.
Then \eqref{B} admits a finite number of rational solutions.
\end{theorem}

\begin{proof} There are two cases.

\textbf{Case 1:}
 Suppose $A_0=0$, (i.e. $y=0$ is a solution). Then
$ B_0\neq 0$. Let $z=1/y$, equation \eqref{B} becomes
\begin{equation}
z'=-\frac{A_{m+2}+\dots +A_1z^{m+1}}{B_m+\dots +B_0z^{m}},
\label{B1}
\end{equation}
which is hyperbolic. Thus equation \eqref{B} admits a finite
number of rational solutions.

\textbf{Case 2:} Suppose $A_0\neq 0$. If \eqref{B} admits a
rational solution $f$. If $z=y-f$, equation \eqref{B} becomes
\begin{equation}
z'=\frac{C_{m+2}z^{m+2}+\dots +C_1z}{D_mz^{m}+\dots +D_0},
\label{B2}
\end{equation}
where $C_i$, $D_i$ are polynomials, $C_0=0\ $and $D_0$ is not
identically zero. This is exactly the first case; i.e., $z=0$ is a
solution. Let $\varphi =\frac{1}{z}$ then \eqref{B}
becomes hyperbolic which has a finite number of rational solutions
$\varphi $. But $\varphi = \frac{1}{z}=\frac{1}{y-f}$, thus
$y=\frac{1}{\varphi }+f$.
\end{proof}

As a corollary, we can compute all the rational solutions of
\eqref{B} if we have at least one particular rational solution of
\eqref{B}.


\begin{example} \label{examp5} \rm
 Consider the equation
\begin{equation}
y'=\frac{y^{4}-y}{-y^{2}+x}.  \label{A1''}
\end{equation}
This equation is parabolic, we can compute all its polynomial
solutions. Furthermore, if we find a polynomial solution of
\eqref{A1''}, we can compute all its rational solutions. Since
$\Omega =\emptyset$, we only look for constant solutions. This
leads us to $y'=0$, and $ y^{4}-y=0$. Thus
$y=0,1,e^{2i\pi/3},e^{4i\pi/3}$. We have four constant solutions of
\eqref{A1''}. Let $z=1/y$ (as in the proof of
Theorem \ref{thm3}, $z=1/(y-f)$ with $f=0$). From \eqref{A1''}, we have
\begin{equation}
z'=\frac{z^3-1}{xz^{2}-1},  \label{B1'}
\end{equation}
which is the same equation in Example \ref{examp4}. In conclusion,
$0,1,e^{2i\pi /3},e^{4i\pi/3}$ and $1/x$ are the
rational solutions of \eqref{A1''}.
\end{example}

\section{The quasi-linear and Riccati cases}

Suppose first that \eqref{A} is quasi-linear. It suffices to
consider the equation
\begin{equation}
B_0y'=A_1y+A_0.  \label{QL}
\end{equation}
We may first determine $\delta $ (the upper bound of $\deg y$)
 by Lemma \ref{lem1}. Replacing $y$ by
$y_{\delta }x^{\delta }+\dots +y_0$ in \eqref{QL}, we obtain
\[
B_0(\delta y_{\delta }x^{\delta -1}+\dots +y_1)=A_1(y_{\delta
}x^{\delta }+\dots +y_0)+A_0.
\]
Then rearranging terms in the resulting equation, we obtain
\[
K_{l}x^{l}+K_{l-1}x^{l-1}+\dots +K_0=0,
\]
where each $K_i$ may depend on $y_0,y_1,\dots,y_{\delta }$,
which is equivalent to following linear system:
$K_{l}=K_{l-1}=\dots =K_0=0$. After solving this system, we obtain
$y_i$.

Next let us compute rational solutions of \eqref{QL}. If
$A_1\equiv 0$, by means of the (classical) partial fraction
decomposition, we see that
\[
y'=\frac{A_0}{B_0}=p(x)+\sum_{d,\alpha }\frac{c(d,\alpha )}{
(x-\alpha )^{d}},
\]
where $p(x)$ is a polynomial, $c(d,\alpha )\in \mathbb{C}$ and the
sum is over the set of roots $\alpha $ of $B_0$ with multiplicity
$d$. Using direct integration, we see that a solution $y$ is
rational if and only if $ c(1,\alpha )=0$ for all $\alpha $.

If $A_1\neq 0$, by Theorem \ref{thm2}, there exits
$\varrho \in \mathbb{N}$
such that $y=u/B_0^{\varrho }$, where $u$ is a
polynomial. Replacing $y$ by $u/B_0^{\varrho }$ in
\eqref{QL}, we obtain
\[
B_0u'=(A_1+\varrho B_0')u+B_0^{\varrho }A_0.
\]
We may then determine $u$.

Note that the number of polynomial or rational solutions of
\eqref{QL} may not be finite. As an example, the equation
\[
xy'=y+x^{2},
\]
has polynomial solutions of the form $x^{2}+\lambda x$ where
$\lambda $ is an arbitrary complex number. As another example,
the equation
\[
y'=\frac{1}{x^{2}}
\]
has rational solutions of the form $-\frac{1}{x}+\lambda $ where
$\lambda $ is an arbitrary complex number.

We now suppose \eqref{A} is Riccati. It suffices to consider the
equation
\begin{equation}
B_0y'=A_2y^{2}+A_1y+A_0  \label{Ri}
\end{equation}
By Theorem \ref{thm1}, we can compute all its polynomial solutions
(finite number). If we have a rational solution $f$ of \eqref{Ri},
then by letting $z=1/(y-f)$, we obtain
\[
-B_0z'=(2fA_2+A_1)z+A_2,
\]
which is a quasi-linear equation. Again, we remark that the number
of rational solutions of \eqref{Ri} may not be finite. For
example, all solutions of the Riccati equation $y'=-y^{2}$ are of
the form
\[
y=\frac{1}{x+\lambda }
\]
where $\lambda $ is an arbitrary complex number.

As our final remark. we can find in \cite[Chapter I]{i1}
elementary methods of integration of classical ODE which can be
used to find the desired solutions in this section.

\begin{thebibliography}{0}

\bibitem{b1} D. Behloul and S. S. Cheng;
\emph{Computation of all polynomial solutions of a class of
nonlinear differential equations}, Computing,
77(2006), 163--177.

\bibitem{b2} D. Behloul and S. S. Cheng;
\emph{Polynomial solutions of a class of
algebraic differential equations with quadratic nonlinearities},
Southeast Asian Bulletin of Mathematics, 33(2009), 1029--1040.

\bibitem{c1} J. G. Campbell and M. Golomb;
\emph{On the polynomial solutions of a Riccati equation},
American Mathematical Monthly, 61(1954), 402--404.

\bibitem{g1} J. Gin\'{e}, M. Grau and J. Llibre;
\emph{On the polynomial limit cycles of polynomial differential
equations}, Israel Journal of Math,
181(2011), 461--475.

\bibitem{i1} E. L. Ince;
\emph{Ordinary Differential Equations}, Dover Publications,
New York, 1956.

\bibitem{m1} J. Malmquist;
\emph{Sur les fonctions a un nombre fini de branches 
d\'{e}finies par les \'{e}quations diff\'{e}rentielles du premier
ordre}, Acta Math., 36(1) (1913), 297--343.

\bibitem{r1} E. D. Rainville;
\emph{Necessary conditions for polynomial solutions of
certain Riccati equation}, American Mathematical Monthly,
43 (1936), 473--476.

\end{thebibliography}

\end{document}
