\documentclass[reqno]{amsart}
\usepackage{hyperref}

\AtBeginDocument{{\noindent\small
\emph{Electronic Journal of Differential Equations},
Vol. 2017 (2017), No. 261, pp. 1--9.\newline
ISSN: 1072-6691. URL: http://ejde.math.txstate.edu or http://ejde.math.unt.edu}
\thanks{\copyright 2017 Texas State University.}
\vspace{8mm}}

\begin{document} 
\title[\hfilneg EJDE-2017/261\hfil Trigonometric polynomial solutions]
{Trigonometric polynomial solutions of equivariant trigonometric polynomial
Abel differential equations}

\author[C. Valls \hfil EJDE-2017/261\hfilneg]
{Cl\`audia Valls}

\address{Cl\`audia Valls \newline
Departamento de Matem\'atica,
Instituto Superior T\'ecnico,
 Universidade de Lisboa, Av. Rovisco Pais
1049--001, Lisboa, Portugal}
\email{cvalls@math.ist.utl.pt}

\dedicatory{Communicated by Vicentiu D. Radulescu}

\thanks{Submitted August 27, 2017. Published October 16, 2017.}
\subjclass[2010]{34A05, 34C05, 37C10}
\keywords{Trigonometric polynomial Abel equations;
\hfill\break\indent  equivariant trigonometric polynomial equation;
 trigonometric polynomial solutions}

\begin{abstract}
 Let $A(\theta)$ non-constant and $B_j(\theta)$ for $j=0,1,2,3$ be real
 trigonometric polynomials of degree at most $\eta \ge 1$ in the variable $x$.
 Then the real equivariant trigonometric polynomial Abel differential equations
 $A(\theta) y' =B_1(\theta) y +B_3 (\theta) y^3$ with $B_3 (\theta)\ne 0$,
 and the real polynomial equivariant trigonometric polynomial Abel differential
 equations of second kind $A(\theta) y y' = B_0(\theta)+ B_2(\theta) y^2$
 with $B_2 (\theta)\ne 0$ have at most $7$ real trigonometric polynomial solutions.
 Moreover there are real trigonometric polynomial equations of these type
 having these maximum number of trigonometric polynomial solutions.
\end{abstract}

\maketitle
\numberwithin{equation}{section}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}
\allowdisplaybreaks

\section{Introduction and statement of the main results}

Abel differential equations of first kind
\begin{equation}\label{eq:0.bis}
a(x) \dot y = b_0(x) +b_1(x) y + b_2(x) y^2 +b_3 (x) y^3
\end{equation}
with $b_3(x)\ne 0$ appear in many textbooks of ordinary
differential equations as one of first non-trivial examples of
nonlinear differential equations, see for instance \cite{K}. Here
the dot denotes the derivative with respect to the independent
variable $x$. If $b_3(x)= b_0(x)=0$ or $b_2(x)= b_0(x)=0$ the Abel
differential equation reduces to a Bernoulli differential equation,
while if $b_3(x)=0$ the Abel differential equation reduces to a
Riccati differential equation.

The Abel differential equations \eqref{eq:0} have been studied
intensively, either calculating their solutions (see for instance
\cite{GL,L,Ma,Pa}), or classifying their centers (see
\cite{BFY,BFY2,BFY3}), and recently in \cite{FL, GTZ, GGL, LV} the
authors studied the polynomial solutions of the differential
equations $y'=\sum_{i=0}^na_i(x)y^i$, or similar.

The analysis of particular solutions (as polynomial or rational
solutions) of the differential equations is important for
understanding the set of solutions of a differential equation. In
1936 Rainville \cite{R} characterized the Riccati differential
equations $\dot y = b_0(x) +b_1(x) y + y^2$, with $b_0(x)$ and
$b_1(x)$ polynomials in the variable $x$, having polynomial
solutions.

In 1954, Campbell and Golomb \cite{CG} provided an algorithm for
determining the polynomial solutions of the Riccati differential
equation $a(x)y'=b_0(x)+b_1(x)y+b_2(x)y^2$, where $a,b_0,b_1,b_2$
are polynomials in the variable $x$. In 2006, Behloul and Cheng \cite{BC} 
gave a different algorithm for finding the rational solutions
of the differential equations $a(x)y'=\sum_{i=0}^nb_i(x)y^i$, where
$a,b_i$ are polynomials in the variable $x$.

The case in which the Abel differential equations \eqref{eq:0} where 
$a(x) \in \mathbb{R}[x] \setminus \{0\}$, $b_i(x) \in \mathbb{R}[x]$, $i=0,1,2,3$ with 
$b_3(x) \ne 0$, where $\mathbb{F}=\mathbb{R},\mathbb{C}$, and $\mathbb{F}[x]:=\mathbb{R}[x]$ is the ring of 
polynomials in the variable $x$ with coefficients in $\mathbb{F}$, being either 
$a(x)$ constant or not and with the equivariant symmetry (see below) 
were studied in \cite{LV1}.

Here we go a step beyond and we consider the Abel differential equations 
\eqref{eq:0.bis} for real trigonometric polynomials, that is
\begin{equation}\label{eq:0}
A(\theta) Y'=B_0(\theta) +B_1(\theta) Y + B_2(\theta) Y^2+B_3(\theta) Y^3,
\end{equation}
where the prime denotes derivative with respect to $\theta$ and where
$A(\theta) \in \mathbb{R}_t(\theta)\setminus \{0\}$, 
$B_i(\theta) \in \mathbb{R}_t(\theta)$, $i=0,1,2,3$,
$B_3(\theta) \ne 0$, being $\mathbb{R}_t[\theta]:=\mathbb{R}[\cos \theta, \sin \theta]$ 
the ring of trigonometric polynomials in the variables $\cos \theta, \sin \theta$ 
with coefficients in $\mathbb{R}$. We also
assume that $A(\theta)$ is not constant. The case $A(\theta)$ constant has
been studied in \cite{GGL}. We also have
 $\eta :=\max \{\alpha,\beta_0,\beta_1, \beta_2, \beta_3\}$, where $\alpha$ 
is the degree of $A(\theta)$, $\beta_i$ is the degree of $B_i(\theta)$ 
for $i=0,1,2,3$. We say that the Abel trigonometric polynomial differential
equation \eqref{eq:0} has degree $\eta$.

Equation \eqref{eq:0} is \emph{reversible} with respect to the
change of variables $(\theta,Y)\to (\theta,-Y)$ if the equation
\[
- A(\theta) Y' =-( B_0(\theta) -B_1(\theta) Y + B_2(\theta) Y^2 -B_3 (\theta) Y^3)
\]
coincides with equation~\eqref{eq:0}. In particular this implies
$B_1(\theta)=B_3(\theta)=0$, and since $B_3(\theta)=0$ we do not consider these
reversible differential equations.

The Abel differential equation \eqref{eq:0} is \emph{equivariant}
with respect to the change of variables $(\theta,Y)\to (\theta,-Y)$ if the
following equation
\[
- A(\theta) Y' = B_0(\theta) -B_1(\theta) Y + B_2(\theta) Y^2 -B_3 (\theta) Y^3
\]
coincides with equation~\eqref{eq:0}. This implies
$B_0(\theta)=B_2(\theta)=0$. In this paper first we focus our study in these
kind of \emph{equivariant trigonometric polynomial Abel equations}, i.e. in the
equations
\begin{equation}\label{eq:1}
A(\theta) Y' = B_1(\theta) Y +B_3 (\theta) Y^3.
\end{equation}

\begin{theorem}\label{thm.1}
Real equivariant trigonometric polynomial Abel differential equations
with $B_3(\theta) \ne 0$ and $A(\theta)$ non-constant, have at most $7$
trigonometric polynomial solutions. Moreover there are equations of this type
having these maximum number of trigonometric polynomial solutions.
\end{theorem}

The proof of Theorem \ref{thm.1} is given in section \ref{sec.3}.

Our second objective in this paper is on the Abel
trigonometric polynomial differential equations of second kind, 
i.e. on the equations of the form
\begin{equation}\label{eq:2}
A(\theta) Y Y' = B_0(\theta) +B_1(\theta) Y + B_2(\theta) Y^2,
\end{equation}
where again the prime denotes derivative in the variable $\theta$, 
$A(\theta),B_i(\theta) \in \mathbb{R}_t(\theta)$ for $i=0,1,2$, with $A(\theta)$ and
$B_2(\theta)$ non-zero. We also consider the ones that are equivariant
with respect to the change $(\theta,Y)\to (\theta,-Y)$. Then we have that
$B_1(\theta)=0$ and so equation \eqref{eq:2} becomes
\begin{equation}\label{eq:2.bis}
A(\theta) Y Y' = B_0(\theta) + B_2(\theta) Y^2.
\end{equation}

We also assume that $B(\theta) \ne 0$ (otherwise would be linear) and 
$A(\theta)$ is not constant, because the case $A(\theta)$
constant has been studied in \cite{FL}. We say that system \eqref{eq:2.bis} 
is an \emph{equivariant trigonometric polynomial Abel differential equation
of second kind}. The study of the number of polynomial solutions of equivariant
 Abel polynomial differential equations of the second kind
\[
a(x) y \dot y =b_0(x) +b_2(x) y^2
\]
where the dot means derivative with respect to $x$, $a(x),b_0(x),b_2(x) \in \mathbb{R}[x]$ 
with $a(x)$ non constant and $b_0(x)b_2(x) \ne 0$ was done in \cite{LV1}.

\begin{theorem}\label{thm.2}
Real equivariant trigonometric polynomial Abel differential equations
of second kind with $B_2(\theta) \ne 0$ and $A(\theta)$ non-constant, have at
most $7$ trigonometric polynomial solutions. Moreover there are equations of this
type having these maximum number of trigonometric polynomial solutions.
\end{theorem}

The proof of Theorem \ref{thm.2} is given in section \ref{sec.4}.


\section{Preliminary results}

As we will see the proof of Theorems \ref{thm.1} and \ref{thm.2} 
are based on divisibility arguments in the ring of polynomials. 
In the ring of trigonometric polynomials we do not have a 
\emph{Unique Factorization Domain}. This can be seen for instance using the
 identity $\cos^2 \theta + \sin^2 \theta =(1-\sin \theta)(1+\sin \theta)$. 
So, $\cos \theta$ divides the right hand expression but it does not 
divide the left hand expression. This difficulty can be overcome 
by using the isomorphism $\Phi \colon R_t(\theta) \to R(x)$ given by
\[
(\cos \theta, \sin \theta) \mapsto \Big(\frac{1-x^2}{1+x^2}, \frac{2x}{1+x^2}\Big)
\]
between the fields $\mathbb{R}_t(\theta)=\mathbb{R}(\cos \theta, \sin \theta)$ and $R(x)$ being 
$\mathbb{R}(x)$ the ring of rational functions. In fact we have the following well-known 
result.

\begin{lemma}\label{lemma.3}
Let $P(\theta) \in \mathbb{R}_t[\theta]$ with $\deg  (P)=\eta$. Then
\[
\Phi(P(\theta))=\frac{p(x)}{(1+x^2)^\eta},
\]
where $\gcd (p(x),1+x^2)=1$ and $\deg  (p(x)) \le 2 \eta$.
Conversely, any rational function $g(x)/(1+x^2)^\eta$ with $g(x)$ an arbitrary 
polynomial of degree at most $2 \eta$ can  be written as a trigonometric 
polynomial through the inverse change $\Phi^{-1}$.
\end{lemma}

Another result that we will  us is the following
 theorem proved in \cite{CGM}.

\begin{theorem}\label{appendix}
Let $p,q \in \mathbb{R}[x]$ be polynomials satisfying $\gcd (p,q)=1$ and
\begin{equation}\label{eq:seven}
p^2+q^2 =r^2, \quad p^2 +\alpha^2 q^2 =s^2
\end{equation}
where $r,s \in \mathbb{R}[x]$ and $\alpha \in \mathbb{R}$. Then either $\alpha=0$ or $\alpha^2 =1$.
\end{theorem}

Now we write how equation \eqref{eq:1} can be written in terms of 
$a(x),b_1(x),b_3(x) \in \mathbb{R}[x]$.

\begin{lemma}\label{lemma.5}
If $Y(\theta)$ is a nonconstant real trigonometric polynomial solution of \eqref{eq:1},
 set
\begin{gather}\label{eq:Y}
Y(\theta)  =\frac{y(x)}{(1+x^2)^{\eta_0}}, \quad 
A(\theta)=\frac{a(x)}{(1+x^2)^{\eta_1}}, \\
B_1(\theta)=\frac{b_1(x)}{(1+x^2)^{\eta_2}}, \quad 
B_3(\theta)=\frac{b_3(x)}{(1+x^2)^{\eta_3}} \nonumber
\end{gather}
with $\deg (y) \le 2 \eta_0$,
$\deg (a) \le 2 \eta_1$, $\deg  (b_1) \le 2 \eta_2$,
$\deg  (b_3) \le 2 \eta_3$ and
$\gcd (y,1+x^2)=\gcd (a,1+x^2)=\gcd (b_1,1+x^2)=\gcd (b_3,1+x^2)=1$. Then equation \eqref{eq:1} becomes
\begin{equation}\label{eq:1.re}
\begin{split}
& \frac{a(x)}{2 (1+x^2)^{\eta_1}}(\dot y(x) (1+x^2) -2 \eta_0 x y(x)) \\
& =\frac{b_1(x)}{(1+x^2)^{\eta_2}} y(x)+\frac{b_3(x)}{(1+x^2)^{\eta_3+2\eta_0}} y(x)^3,
\end{split}
\end{equation}
where the dot denotes derivative with respect to $x$.
\end{lemma}

\begin{proof}
From the diffeomorphism $\Phi$ we have that
\[
x' =\frac{dx}{d \theta} =\frac{1+x^2}2
\]
and so
\[
Y(\theta)' = \frac{\dot y(x) (1+x^2)-2 \eta_0 x y(x)}{2 (1+x^2)^{\eta_0}},
\]
where the dot and the prime denote the derivative with respect to $x$ and $\theta$,
 respectively. So, equation \eqref{eq:1} becomes \eqref{eq:1.re}.
\end{proof}

In the same manner as in the proof of Lemma \ref{lemma.5} we can
 see how equation \eqref{eq:2.bis} can be written in terms of
 $a(x),b_0(x),b_2(x) \in \mathbb{R}[x]$.

\begin{lemma}\label{lemma.6}
If $Y(\theta)$ is a nonconstant real trigonometric polynomial solution of 
\eqref{eq:2.bis}, set $Y(\theta), A(\theta)$ as in \eqref{eq:Y} and
\[
\begin{split}
 B_0(\theta)=\frac{b_0(x)}{(1+x^2)^{\eta_2}}, \quad
 B_2(\theta)=\frac{b_2(x)}{(1+x^2)^{\eta_3}}
\end{split}
\]
with $\deg (y) \le 2 \eta_0$, $\deg (a) \le 2 \eta_1$, 
$\deg  (b_0) \le 2 \eta_2$, $\deg  (b_2) \le 2 \eta_3$, and 
$\gcd (y,1+x^2)=\gcd (a,1+x^2)=\gcd (b_0,1+x^2)=\gcd (b_2,1+x^2)=1$. 
Then equation \eqref{eq:2.bis} becomes
\begin{equation}\label{eq:2.re}
\begin{split}
& \frac{a(x)}{2 (1+x^2)^{\eta_1}}(y(x)\dot y(x) (1+x^2) -2 \eta_0 x y(x)^2)\\
 & =\frac{b_0(x)}{(1+x^2)^{\eta_2-2\eta_0}} y(x)+\frac{b_2(x)}{(1+x^2)^{\eta_3}} y(x)^2,
\end{split}
\end{equation}
where the dot denotes derivative with respect to $x$.
\end{lemma}


\section{Proof of Theorem \ref{thm.1}}\label{sec.3}

First we recall that if $Y(\theta) \ne 0$ is a solution of
\eqref{eq:1}, then $-Y(\theta)$ is also a solution of equation
\eqref{eq:1} which is different from $Y(\theta)$.

\begin{lemma}\label{lemma.7}
Let $Y_0(\theta) \ne 0$, $Y_1(\theta),Y_2(\theta)$ be polynomial solutions of
equation \eqref{eq:1} such that $Y_1(\theta) \not \equiv 0$, $Y_2(\theta) \not
\equiv 0$ and $Y_2(\theta) \ne -Y_1(\theta)$. Set
\[
Y_i(\theta)=\frac{y_i(x)}{(1+x^2)^{\eta_i}}, \quad i=0,1,2
\]
where $\eta_i=\deg  (Y_i)$ and $\deg  (y_i) \le 2 \eta_i$, $\eta_1 \le \eta_2$ 
and $\gcd  (y_i,1+x^2)=1$ for $i=0,1,2$. We write $y_1(x)=g(x) \tilde y_1(x)$
and $y_2(x)=g(x) \tilde y_2(x)$ where $g=\gcd (y_1,y_2)$. Then,
except the solution $Y=0$, all the other polynomial solutions of
equation \eqref{eq:1} can be expressed as
\begin{equation}\label{eq:9}
y_0(\theta;c)= \pm \frac{\tilde y_1(x) \tilde y_2(x) g(x)}{\big(c \tilde
y_1^2(x)(1+x^2)^{2(\eta_2-\eta_1)} +(1-c) \tilde y_2^2(x)\big)^{1/2}},
\end{equation}
where $c$ is a constant and $\big(c \tilde y_1^2(x)(1+x^2)^{2(\eta_2-\eta_1)} +(1-c) \tilde
y_2^2(x)\big)^{1/2}$ is a polynomial.
\end{lemma}

\begin{proof}
Let $Y$ be a nonzero trigonometric polynomial solution of \eqref{eq:1}.
The functions $Z_0=1/Y_0^2$, $Z_1=1/Y_1^2$ and $Z_2=1/Y_2^2$ are
solutions of a linear differential equation and satisfy
\[
-A(\theta) Z_i(\theta)'  = 2 B_1 (\theta) Z_i +2 B_3 (\theta), \quad i=0,1,2.
\]
Therefore we have
\[
\frac{Z_0(\theta)'-Z_1(\theta)'}{Z_0(\theta) -Z_1(\theta)} = \frac{
Z_2(\theta)'- Z_1(\theta)'}{Z_2(\theta) -Z_1(\theta)}.
\]
Integrating this equality we obtain
\[
Z_0(\theta)= Z_1(\theta) + c (Z_2(\theta) -Z_1(\theta)),
\]
with $c$ an arbitrary constant. So the general solution of
equation~\eqref{eq:1} is
\[
\begin{split}
Y_0^2(\theta) 
& = \frac{1}{Z_0(\theta)}=\frac{1}{Z_1(\theta)+c(Z_2(\theta)-Z_1(\theta))} \\
&=\frac{Y^2_1(\theta) Y^2_2(\theta)}{c Y_1^2(\theta) + (1-c) Y_2^2(\theta)}
\end{split}
\]
In other words,
\begin{equation}\label{eq:anormal.bis}
\frac{y_0(x)^2}{(1+x^2)^{2(\eta_0-\eta_1)}} 
=\frac{g(x)^2 \tilde y^2_1(x) \tilde y^2_2(x)}{c (1+x^2)^{2(\eta_2-\eta_1)} 
\tilde y_1^2(x) + (1-c) \tilde y_2^2(x)}.
\end{equation}
Since the right-hand side of equation \eqref{eq:anormal.bis} is not divisible 
by $1+x^2$ we must have that $\eta_0 \ge \eta_1$. However, if $\eta_0 > \eta_1$
 since neither $\tilde y_2$ nor $y_0$ (and when $\eta_1=\eta_2$ then also 
$\tilde y_1$) do not divide $1+x^2$, we get a contradiction with
 \eqref{eq:anormal.bis}. In short we must have $\eta_0=\eta_1$. 
Then equation \eqref{eq:anormal.bis} becomes
\[
y_0(x)^2 =  \frac{g(x)^2 \tilde y^2_1(x) \tilde y^2_2(x)}{c (1+x^2)^{2(\eta_2-\eta_1)}
 \tilde y_1^2(x) + (1-c) \tilde y_2^2(x)}
\]
with $c$ an arbitrary constant.
\end{proof}

In view of Lemma \ref{lemma.5}, if $Y_1(\theta),Y_2(\theta)$ are trigonometric 
polynomial solutions  of equation \eqref{eq:1} such that $Y_1(\theta) \not \equiv
0$, $Y_2(\theta) \not \equiv 0$, $Y_2(\theta) \ne Y_1(\theta)$, then any other 
trigonometric polynomial solution different from them is of the form given in
\eqref{eq:9} for some appropriate constant $c$ such that 
$c \not \in \{0,1\}$. In particular, 
$c\tilde y_1^2(x)(1+x^2)^{2(\eta_2-\eta_1)} +(1-c) \tilde y_2^2(x)$, 
or $\tilde y_3^2(x) +(1-c) \tilde y_2^2(x)/c$, where 
$\tilde y_3(x)=(1+x^2)^{\eta_2-\eta_1} \tilde y_1(x)$
is a square of a polynomial $p$ and $p$ divides $g$. 
In view of Theorem \ref{appendix}
 there is at most one constant $c \not \in \{0,1\}$ such
that $c \tilde y_1^2 (1+x^2)^{2(\eta_2-\eta_1)} +(1-c) \tilde y_2^2$ is a
 square of a polynomial meaning that equation \eqref{eq:1} has at most seven
different trigonometric polynomial solutions $0$, $\pm Y_1$, $\pm Y_2$ and $Y_0$.

\begin{example} \label{examp1} \rm 
Note that in view of Lemma \ref{lemma.5}, the polynomial solutions 
$y_1,y_2$ and $y_0$ can always be taken of the form
\[
y_1=\pm \frac{r s (r^2+s^2)}{2\sqrt{c}}, \quad 
y_2=\pm \frac{r s(r^2-s^2)}{2\sqrt{c-1}}, \quad
 y_0= \pm \frac{(r^2+s^2)(r^2-s^2)}{4 \sqrt{c}\sqrt{c-1}}
\]
with $r^2-s^2$ and $r^2+s^2 $ coprime. For instance one can take
$r=1$, $s=2x$, $c=2$, and then
\[
y_1=\pm \Big( 2 \sqrt{2} x^3+\frac{x}{\sqrt{2}}\Big), \quad
y_2= \pm (x-4 x^3), \quad 
y_0=\pm \Big( \frac{1}{4 \sqrt{2}}-2 \sqrt{2} x^4 \Big).
\]
We recall that these are polynomial solutions of the equation
\[
a(x) \dot y = b_1(x) y + b_3(x) y^3,
\]
with
\begin{gather*}
a(x)=  -2 x + 48 x^3 - 768 x^7 + 512 x^9,  \\
b_1(x)= 2 (-1 + 96 x^4 - 1536 x^6 + 768 x^8),  \\
b_3(x)= 64.
\end{gather*}
Therefore, in view of Lemmas \ref{lemma.5} and \ref{lemma.3} if we set
\begin{gather*}
A(\theta)  =\frac{2 a(x)}{(1+x^2)^5}=\frac{-2 x + 48 x^3 - 768 x^7 
+ 512 x^9}{(1+x^2)^5}, \\
B_0(\theta) = \frac{b_0(x) (1+x^2)-4 x a(x)}{(1+x^2)^5}
=\frac{-2 + 6 x^2 - 2880 x^6 + 1536 x^8 - 540 x^{10}}{(1+x^2)^5},\\
B_2(\theta) =\frac{b_2(x)}{(1+x^2)^2}= \frac{64}{(1+x^2)^2},
\end{gather*}
then, the seven solutions
\[
Y_1(\theta)= \pm \frac{y_1(x)}{(1+x^2)^2}, \quad 
Y_2(\theta)= \pm \frac{y_2(x)}{(1+x^2)^2}, \quad 
Y_0(\theta)= \pm \frac{y_0(x)}{(1+x^2)^2}, \quad 
Y_3(\theta)=0
\]
are trigonometric polynomial solutions of equation \eqref{eq:2.bis}.


\section{Proof of Theorem \ref{thm.2}}\label{sec.4}

First we recall that if $Y(\theta) \ne 0$ is a solution of
\eqref{eq:2.bis}, then $-Y(\theta)$ is also a solution of
 \eqref{eq:2.bis} which is different from $Y(\theta)$.

\begin{lemma}\label{lemma.5.bis}
Let $Y_0(\theta) \ne 0$, $Y_1(\theta),Y_2(\theta)$ be polynomial solutions of
equation \eqref{eq:2.bis} such that $Y_1(\theta) \not \equiv 0$, 
$Y_2(\theta) \not \equiv 0$ and $Y_2(\theta) \ne -Y_1(\theta)$. Set
\[
Y_i(\theta)=\frac{Y_i(x)}{(1+x^2)^{\eta_i}}, \quad i=1,2
\]
where $\eta_i=\deg  (Y_i)$ and $\deg  (y_i) \le 2 \eta_i$, 
$\eta_1 \le \eta_2$ and $\gcd  (y_i,1+x^2)=1$ for $i=1,2$. 
We write $y_1(x)=g(x) \tilde y_1(x)$
and $y_2(x)=g(x) \tilde y_2(x)$ where $g=\gcd (y_1,y_2)$. 
Then, except the solution $Y=0$, all the other
trigonometric polynomial solutions of equation \eqref{eq:2.bis} can be expressed
as
\begin{equation}\label{eq:9.bis}
y_0(\theta;c)= \pm g(x) \big(c
\tilde y_1^2(x) (1+x^2)^{2(\eta_2-\eta_1)}+(1-c)  \tilde y_2^2(x)\big)^{1/2},
\end{equation}
where $c$ is a constant.
\end{lemma}

\begin{proof}
Let $Y$ be a nonzero trigonometric polynomial solution of equation \eqref{eq:1}.
The functions $Z_0=Y_0^2$, $Z_1=Y_1^2$ and $Z_2=Y_2^2$ are solutions
of a linear differential equation and satisfy
\[
A(\theta) Z_i'  = 2 B_0 (\theta)  +2 B_2 (\theta) Z_i, \quad i=0,1,2.
\]
Therefore
\[
\frac{Z_0(\theta)'-Z_1(\theta)'}{Z_0(\theta) -Z_1(\theta)} 
= \frac{Z_2(\theta)'-Z_1(\theta)'}{Z_2(\theta) -Z_1(\theta)}.
\]
Integrating this equality we obtain
\[
Z_0(\theta)= Z_1(\theta) + c (Z_2(\theta) -Z_1(\theta)),
\]
with $c$ an arbitrary constant. So the general solution of
equation~\eqref{eq:1} is
\[
Y_0^2(\theta)  = Z_0(\theta)=Z_1(\theta)+c(Z_2(\theta)-Z_1(\theta)) 
=(1-c) Y_1^2(\theta) + c Y_2^2(\theta),
\]
where $c$ is an arbitrary constant. Hence, we have
\[
\begin{split}
\frac{y_0^2}{(1+x^2)^{2\eta_0}} 
& = \frac{(1-c)y_1^2(x)}{(1+x^2)^{2 \eta_1}}
  + \frac{c y_2^2(x)}{(1+x^2)^{2 \eta_2}} \\
& =\frac{(1-c) y_1^2(x) (1+x^2)^{2(\eta_2-\eta_1)} 
 +c y_2(x)^2}{(1+x^2)^{2 \eta_2}}.
\end{split}
\]
In other words,
\begin{equation}\label{eq:anormal}
\frac{y_0(x)^2}{(1+x^2)^{2(\eta_0-\eta_2)}} 
= g(x)^2 ((1-c) \tilde y_1(x)^2 (1+x^2)^{(2 (\eta_2-\eta_1)} + c \tilde y_2(x)^2).
\end{equation}
Since the right-hand side of equation \eqref{eq:anormal} is a polynomial and 
$y_0(x)$ does not divide $1+x^2$, we must have that $\eta_0 \le \eta_2$.
 However, if $\eta_0 < \eta_2$ since $\tilde y_2$ does not divide $1+x^2$ 
we get a contradiction with \eqref{eq:anormal}. In short we must have 
$\eta_0=\eta_2$. Then equation \eqref{eq:anormal} becomes
\[
y_0(x)^2 =  g(x)^2 ((1-c) \tilde y_1(x)^2 (1+x^2)^{2( \eta_2-\eta_1)} 
+ c \tilde y_2(x)^2)
\]
with $c$ an arbitrary constant.
\end{proof}

In view of Lemma \ref{lemma.5}, if $Y_1(\theta),Y_2(\theta)$ are trigonometric 
polynomial solutions of equation \eqref{eq:2.bis} such that 
$Y_1(\theta) \not \equiv
0$, $Y_2(\theta) \not \equiv 0$ and $Y_2(\theta) \ne -Y_1(\theta)$ 
then any other trigonometric
polynomial solution is of the form as in \eqref{eq:9.bis} for some
appropriate constant $c$. In particular, 
$c \tilde y_1^2(x) (1+x^2)^{2( \eta_2-\eta_1)}+(1-c)
\tilde y_2^2(x)$ is a square of a polynomial $pP$. 
In view of Theorem \ref{appendix} this $c$ is unique and we conclude that 
\eqref{eq:2.bis} has at most seven different trigonometric polynomial solutions
$0$, $\pm Y_1$, $\pm Y_2$ and $ Y_0$.
\end{example}


\begin{example} \label{examp2} \rm 
Note that in view of Lemma \ref{lemma.5.bis}, the polynomial solutions 
$y_1,y_2$ and $y_0$ can always be taken of the form
\[
y_1=\pm \frac{r^2+s^2}{\sqrt{c}}, \quad 
y_2=\pm \frac{r^2-s^2}{\sqrt{c-1}}, \quad y_0= \pm 2 r s
\]
with $r^2-s^2$ and $r^2+s^2 $ coprime. For instance one can take
\[
r=\sqrt{2}x, \quad s=\frac{1}{\sqrt{2}}, \quad c=2,
\]
and then
\[
y_1=\pm \Big(\sqrt{2} x^2+\frac{1}{2 \sqrt{2}}\Big), \quad 
y_2= \pm \Big(2 x^2-\frac 1 2\Big), \quad y_0=\pm 2 x.
\]
We recall that these are polynomial solutions of the equation
\[
a(x) y \dot y = b_0(x) y + b_2(x) y^2,
\]
with
\begin{gather*}
a(x)= 2 x^4-3 x^2+\frac{1}{8}, \vspace{0.2cm}\\
b_0(x)= \frac{x}{2}-8 x^5, \vspace{0.2cm}\\
b_2(x)= 4 x^3-3 x.
\end{gather*}
Therefore, in view of Lemmas \ref{lemma.6} and \ref{lemma.3}, if we set
\begin{gather*}
A(\theta)  =\frac{2 a(x)}{(1+x^2)^5}=\frac{4 x^4 -6 x^2 + 1/4}{(1+x^2)^5}, \\
B_0(\theta) = \frac{b_0(x) (1+x^2)-2 x a(x)}{(1+x^2)^5}
=\frac{x(1 + 26 x^2 - 48 x^4 - 32 x^6)}{4(1+x^2)^5},\\
B_2(\theta) =\frac{b_2(x)}{(1+x^2)^2}= \frac{4 x^3-3 x}{(1+x^2)^2},
\end{gather*}
then, the solutions
\[
Y_1(\theta)= \frac{y_1(x)}{1+x^2}, \quad 
Y_2(\theta)= \frac{y_2(x)}{1+x^2}, \quad 
Y_0(\theta)=\frac{2 x}{1+x^2}, \quad Y_3(\theta)=0
\]
are trigonometric polynomial solutions of equation \eqref{eq:2.bis}.
\end{example}

\subsection*{Acknowledgements}
This research was partially supported by FCT/Portugal through UID/MAT/04459/2013.

\begin{thebibliography}{99}

\bibitem{BC} D. Behloul, S. S. Cheng;
\emph{Computation of all polynomial solutions of a class of nonlinear
differential equations}, Computing \textbf{77} (2006), 163--177.

\bibitem{BFY} M. Briskin, J. P. Fran\c{c}oise, Y. Yomdin;
\emph{Center conditions, compositions of polynomials and moments on
algebraic curves},  Ergodic Theory \& Dynam. Systems \textbf{19}
(1999), 1201--1220.

\bibitem{BFY2} M. Briskin, J. P. Fran\c{c}oise, Y. Yomdin;
\emph{Center conditions. II. Parametric and model center problems},
Israel J. Math. \textbf{118} (2000), 61--82.

\bibitem{BFY3} M. Briskin, J. P. Fran\c{c}oise, Y. Yomdin;
\emph{Center conditions. III. Parametric and model center problems},
Israel J. Math. \textbf{118} (2000), 83--108.

\bibitem{CG} J. G. Campbell, M. Golomb;
\emph{On the polynomial solutions of a Riccati equation}, The Amer.
Math. Monthly \textbf{61} (1954), 402--404.

\bibitem{CGM} A. Cima, A. Gasull, F. Maņosas;
\emph{On the number of polynomial solutions of Bernouilli and Abel polynomial 
differential equations}, Preprint.

\bibitem{FL} A. Ferragut, J. Llibre;
\emph{On the polynomial solutions of the polynomial differential
equations $y \dot y = a_0(x) + a_1(x) y^2 + \ldots + a_n (x) y^n $},
Preprint, 2016.

\bibitem{GL} A. Gasull, J. Llibre;
\emph{Limit cycles for a class of Abel equations}, SIAM J. Math.
Anal. \textbf{21} (1990), 1235--1244.

\bibitem {GTZ} A. Gasull, J. Torregrosa, X. Zhang;
\emph{The number of polynomial solutions of polynomial Riccati
equations}, J. Differential Equations \textbf{261} (2016), 5071--5093.

\bibitem{GGL} J. Gin\'e, M. Grau, J. Llibre;
\emph{On the polynomial limit cycles of polynomial differential
equations}, Israel J. Math. \textbf{181} (2011), 461--475.

\bibitem{K} E. Kamke;
\emph{Differentialgleichungen: L\"osungsmethoden und L\"osungen},
Springer 1977.

\bibitem{L} A. Lins Neto;
\emph{On the number of solutions of the equation $dx/dt=\sum
\sp{n}\sb{j=0}\,a\sb{j}(t)x\sp{j}$, $0\leq t\leq 1$, for which
$x(0)=x(1)$}, Invent. Math. \textbf{59} (1980), 67--76.

\bibitem{LV} J. Llibre, C. Valls;
\emph{Liouvillian first integrals for generalized Riccati polynomial
differential systems}, Advanced Nonlinear Studies \textbf{15} (2015),
951--961.

\bibitem{LV1} J. Llibre, C. Valls;
\emph{Polynomial solutions of equivariant polynomial Abel differential equations}, 
Preprint, 2017.

\bibitem{Ma} M.P. Markakis;
\emph{Closed-form solutions of certain Abel equations of the first
kind}, Appl. Math. Lett. \textbf{22} (2009), 1401--1405.

\bibitem{Pa} D. E. Panayotounakos;
\emph{Exact analytic solutions of unsolvable classes of first and
second order nonlinear ODEs. I. Abel's equations}, Appl. Math. Lett.
\textbf{18} (2005), 155--162.

\bibitem{R} E. D. Rainville;
\emph{Necessary conditions for polynomial solutions of certain
Riccati equations}, The Amer. Math. Monthly \textbf{43} (1936),
473--476.

\end{thebibliography}

\end{document}

