1 Introduction and the main results

Planar polynomial differential systems play an important role in the qualitative theory of dynamical systems due to their many applications in physics, chemist, biology, economics, …. Nowadays the qualitative theory has gained wide development for polynomial systems. For a planar differential system, the existence of a first integral determines completely its global dynamical behavior. So a natural problem arises: Given a polynomial differential system in \(\mathbb{R}^{2}\) or \(\mathbb{C}^{2}\), how to decide if this system has a first integral? For general polynomial differential systems this problem is very difficult to solve. During the past three decades many mathematicians investigated the integrability of different classes of polynomial differential systems, such as Liénard systems [5, 13, 15, 16], Lotka-Volterra systems [7, 8, 1012], and quasi-homogeneous polynomial systems [14, 6, 17], etc.

Let ℂ be the set of complex numbers and \(\mathbb{C}[x]\) be the ring of all complex polynomials in the variable \(x\). We consider the following complex polynomial differential systems

$$\begin{aligned} &\dot{x}=h\left (x\right )f\left (y\right ),\quad \dot{y}=g\left (y \right ), \end{aligned}$$
(1)

where \(h\in \mathbb{C}\left [x\right ]\) and \(f,g\in \mathbb{C}\left [y\right ]\) are coprime. The associated vector field of this system is

$$\begin{aligned} &\mathcal{X}=h\left (x\right )f\left (y\right ) \frac{\partial }{\partial x}+g\left (y\right ) \frac{\partial }{\partial y}. \end{aligned}$$
(2)

The integer \(d=\max \left \{ \text{deg}\;hf,\text{deg}\;g\right \} \) is the degree of the vector field \(\mathcal{X}\).

Let \(U\) be an open set of \(\mathbb{C}^{2}\). A non-locally constant function \(H: U\rightarrow \mathbb{C}\) is called a first integral of system (1) if it is constant along any solution curve of system (1) contained in \(U\). If \(H\left (x,y\right )\) is differentiable, then \(H\) is a first integral of system (1) if and only if

$$\begin{aligned} &\mathcal{X}H=h\left (x\right )f\left (y\right ) \frac{\partial H}{\partial x}+g\left (y\right ) \frac{\partial H}{\partial y}=0 \end{aligned}$$
(3)

in \(U\).

System (1) has an analytic first integral if there exists a first integral \(H\left (x,y\right )\) which is an analytic function in the variables \(x\) and \(y\). A function of the form \(\varphi (y)=a\prod _{i=1}^{k}\left (y-\alpha _{i}\right )^{\gamma _{i}}\) is called a product function with \(\alpha _{j},\gamma _{j} \in \mathbb{C}\) and \(a\in \mathbb{C}\setminus \{0\}\). The polynomial function \(\varphi \left (y\right )\) is square-free if it can be written as \(\varphi \left (y\right )= a\prod _{i=1}^{k}\left (y-\alpha _{i} \right )\) with \(a\in \mathbb{C}\setminus \{0\}\), \(\alpha _{i}\neq \alpha _{j}\) for \(i,j=1,\ldots ,k\) and \(i\neq j\). We say that system (1) has a generalized analytic first integral if there exists a first integral \(H\left (x,y\right )\) which is an analytic function in the variable \(x\) whose coefficients are product functions in the variable \(y\).

Let

$$ F\left (z\right )=\sum _{n=-\infty }^{\infty }a_{n}\left (z-z_{0} \right )^{n} $$

be a Laurent expansion at a point \(z_{0}\). The coefficient \(a_{-1}= \text{Res}\left [F\left (z\right ), z_{0}\right ]\) is the residue of \(F\left (z\right )\) at \(z_{0}\).

Differential system (1) of separable variables has a lot of applications. For example Giné et al. in Lemma 2.2 of [6] proved that any planar quasi-homogeneous polynomial differential system can be transformed into a polynomial differential system (1) of the form

$$\begin{aligned} &\dot{x}=xf\left (y\right ),\quad \dot{y}=g\left (y\right ), \end{aligned}$$
(4)

with \(f\left (y\right ), g\left (y\right )\in \mathbb{C}\left [y\right ]\). Hence the study of the type of integrability of the quasi-homogeneous polynomial systems can be reduced to study the type of integrability of their corresponding polynomial systems (4). Note that the polynomial differential systems (4) is a subclass of polynomial differential systems (1). In this paper we generalize some known facts for the systems (4) to systems (1), and provide other new results.

First we present a necessary condition for the existence of generalized analytic first integrals of system (1).

Theorem 1

Assume that \(\alpha _{1},\ldots ,\alpha _{k}\) are the different roots of the polynomial \(g\left (y\right )\). If system (1) has a generalized analytic first integral, then it must satisfy one of the following two conditions.

  1. (a)

    The polynomials \(h\left (x\right )\) and \(g\left (y\right )\) are square-free, and \(\operatorname{deg}f<\operatorname{deg}g\).

  2. (b)

    The roots of the polynomial \(h\left (x\right )\) are not simple and the \(\operatorname{Res}\left [f\left (y\right )/g\left (y\right ), \alpha _{i} \right ]=0\) for all \(i=1,\ldots ,k\).

The following result is due to Llibre and Valls, see Theorem 1.1 of [14].

Theorem 2

Let \(h\left (x\right )=x\). Then the polynomial differential system (1) has a generalized analytic first integral if and only if \(g\left (y\right )\) is square-free, and \(\operatorname{deg} f<\operatorname{deg}g\).

In the next theorem we generalize Theorem 2 when \(h\left (x\right )= \left (ax+b\right )^{m}\), where \(a\in \mathbb{C}\setminus \{0\}\) and \(m\in \mathbb{N}\). As usual ℕ denotes the set of positive integers.

Theorem 3

Let \(h\left (x\right )=\left (ax+b\right )^{m}\) with \(a\in \mathbb{C}\setminus \{0\}\) and \(m\in \mathbb{N}\). Assume that \(\alpha _{1},\ldots ,\alpha _{k}\) are the different roots of the polynomial \(g\left (y\right )\). The following statements hold.

  1. (a)

    If \(m=1\), then system (1) has a generalized analytic first integral if and only if \(g\left (y\right )\) is square-free, and \(\operatorname{deg} f<\operatorname{deg} g\).

  2. (b)

    If \(m\geq 2\), then system (1) has a generalized analytic first integral if and only if \(\operatorname{Res}\left [f\left ( y\right )/g \left (y\right ),\alpha _{i} \right ]=0\) for all \(i=1,\ldots ,k\).

System (4) has a polynomial first integral if and only if \(g\left (y\right )\) is square-free, \(\operatorname{deg}f<\operatorname{deg}g\) and \(\operatorname{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{j} \right ]\in \mathbb{Q}^{-}\) for \(j=1,\ldots ,k\), see statement \((viii)\) of Lemma 2.4 of [6]. For the more general polynomial differential system (1) we provide necessary and sufficient conditions for its polynomial integrability in the following theorem.

Theorem 4

Let \(\alpha _{1},\ldots ,\alpha _{k}\) be different roots of the polynomial \(g\left (y\right )\). System (1) has a polynomial first integral if and only if the two following conditions hold.

  1. (a)

    The polynomials \(h\left (x\right )=ax+b\) and \(g\left (y\right )\) is square-free, and \(\operatorname{deg}f<\operatorname{deg}g\).

  2. (b)

    \(a\operatorname{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{j} \right ]\in \mathbb{Q}^{-}\) for \(j=1,\ldots ,k\).

This paper is organized as follows. We present some preliminary results in Sect. 2. The proofs of Theorems 1, 3 and 4 are given in Sect. 3. In Sect. 4 we illustrate our results with some examples.

2 Preliminaries

In this section we introduce some necessary lemmas for the proof of Theorems 1, 3 and 4. The following lemma can be found in many textbooks, as for instance in [9].

Lemma 5

Assume that \(F,G \in \mathbb{C}\left [y\right ]\) are coprime with \(\operatorname{deg}F<\operatorname{deg}G=w\). Let \(p\) be the coefficient of the monomial \(y^{w}\) of the polynomial \(G\left (y\right )\) and \(q\) the one of the monomial \(y^{w-1}\) of the polynomial \(F\left (y\right )\).

  1. (a)

    If \(y_{1},y_{2},\ldots ,y_{s}\) are the distinct roots of \(G\left (y\right )\) with multiplicity \(n_{1},n_{2},\ldots ,n_{s}\), respectively, then

    $$\begin{aligned} &\frac{F\left (y\right )}{G\left (y\right )}=\sum _{i=1}^{s}\sum _{j=1}^{n_{i}} \frac{t_{i,j}}{\left (y-y_{i}\right )^{j}}, \end{aligned}$$
    (5)

    where \(t_{i,1}=\operatorname{Res}\left [F\left (y\right )/G\left (y\right ),y_{i} \right ]\) and \(t_{i,n_{i}}\neq 0\) for \(i=1,\ldots ,s\).

  2. (b)

    If \(G\left (y\right )\) is square-free that is \(G\left (y\right )=\prod _{i=1}^{w}\left (y-y_{i}\right )\), then

    $$\begin{aligned} &\frac{F\left (y\right )}{G\left (y\right )}=\sum _{i=1}^{w} \frac{t_{i}}{y-y_{i}}, \end{aligned}$$
    (6)

    where

    $$\begin{aligned} &t_{i}=\operatorname{Res}\left [F\left (y\right )/G\left (y\right ),y_{i} \right ]\;for\;i=1,\ldots ,w\quad and \quad \sum _{i=1}^{w}t_{i}=q/p. \end{aligned}$$
    (7)

The rational function \(F\left (y\right )/G\left (y\right )\) is a square-free rational function if it satisfies statement \((b)\) of Lemma 5.

Lemma 6

The function \(\varphi \left (y\right )\) is a product function if and only if \(\varphi '\left (y\right )/\varphi \left (y\right )\) is a square-free rational function.

Proof

Necessity. Assume that \(\varphi \left (y\right )\) is the product function \(\varphi \left (y\right )=a\prod _{i=1}^{k}\left (y-\alpha _{i} \right )^{\gamma _{i}}\). Then

$$\begin{aligned} &\ln \varphi \left (y\right )=\ln a+\sum _{i=1}^{k}\gamma _{i}\ln \left (y-\alpha _{i}\right ). \end{aligned}$$
(8)

Derivating equation (8) with respect to \(y\), we get that

$$\begin{aligned} &\frac{\varphi '\left (y\right )}{\varphi \left (y\right )}=\sum _{i=1}^{k} \frac{\gamma _{i}}{y-\alpha _{i}} \end{aligned}$$
(9)

is a square-free rational function. Hence necessity is proved.

Sufficiency. Since \(\varphi '\left (y\right )/\varphi \left (y\right )\) is a square-free rational function we have equation (9). Integrating equation (9) we get

$$ \varphi \left (y\right )=a\prod _{i=1}^{k}\left (y-\alpha _{i}\right )^{ \gamma _{i}}, $$

where \(a\) is an integration constant. The proof of Lemma 6 is completed. □

Consider \(h\left (x\right )=\sum _{i=0}^{m-n}h_{n+i}x^{n+i}\) with \(m\geq n\geq 1\), \(h_{n+i}\in \mathbb{C}\) and \(h_{m}h_{n}\neq 0\). If system (1) has a generalized analytic first integral \(H\left (x,y\right )\), then \(H\left (x,y\right )\) can be written as a power series in \(x\) of the form

$$\begin{aligned} &H\left (x,y\right )=\sum _{j\geq 0}a_{j}\left (y\right )x^{j}, \end{aligned}$$
(10)

where the coefficients \(a_{j}\left (y\right )\) are product functions in the variable \(y\). From equation (3) we obtain

$$ \begin{aligned} \mathcal{X}H&=\sum _{j\geq 0}jf\left (y\right )a_{j} \left (y\right )\left (\sum _{i=0}^{m-n}h_{n+i}x^{n+i}\right )x^{j-1} + \sum _{j\geq 0}g\left (y\right )a'_{j}\left (y\right )x^{j} \\ &=f\left (y\right )\sum _{i=0}^{m-n}\sum _{j\geq 0}jh_{n+i}a_{j} \left (y\right )x^{n+i+j-1} +g\left (y\right )\sum _{j\geq 0}a'_{j} \left (y\right )x^{j}=0. \end{aligned} $$
(11)

The equation

$$ \sum _{i=0}^{m-n}\sum _{j\geq 0}jh_{n+i}a_{j}\left (y\right )x^{n+i+j-1} $$

can be decomposed into sum of the following equations:

$$\begin{aligned} \text{for}\;&i=m-n,\; \sum _{j\geq 0}jh_{m}a_{j}\left (y\right )x^{m+j-1}; \\ \text{for}\;&i=m-n-1,\;\sum _{j\geq 0}jh_{m-1}a_{j}\left (y\right )x^{m+j-2}= \sum _{j\geq 0}\left (j+1\right )h_{m-1}a_{j+1}\left (y\right )x^{m+j-1}; \\ \text{for}\;&i=m-n-2, \\ &\sum _{j\geq 0}jh_{m-2}a_{j}\left (y\right )x^{m+j-3}=\sum _{j\geq 0} \left (j+2\right )h_{m-2}a_{j+2}\left (y\right )x^{m+j-1}\\ &\quad +\sum _{j=0}^{1}jh_{m-2}a_{j} \left (y\right )x^{m+j-3}; \\ \text{for}\;&i=m-n-3, \\ &\sum _{j\geq 0}jh_{m-3}a_{j}\left (y\right )x^{m+j-4}=\sum _{j\geq 0} \left (j+3\right )h_{m-3}a_{j+3}\left (y\right )x^{m+j-1}\\ & + \sum _{j=0}^{2}jh_{m-3}a_{j} \left (y\right )x^{m+j-4}; \\ \text{for}\;&i=m-n-4, \\ &\sum _{j\geq 0}jh_{m-4}a_{j}\left (y\right )x^{m+j-5}=\sum _{j\geq 0} \left (j+4\right )h_{m-4}a_{j+4}\left (y\right )x^{m+j-1}\\ & + \sum _{j=0}^{3}jh_{m-4}a_{j} \left (y\right )x^{m+j-5}; \\ &\vdots \\ \text{for}\;&i=2, \\ &\sum _{j\geq 0}jh_{n+2}a_{j}\left (y\right )x^{n+j+1}=\sum _{j\geq 0} \left (m-n+j-2\right )h_{n+2}a_{m-n+j-2}\left (y\right )x^{m+j-1} \\ &+ \sum _{j=0}^{m-n-3}jh_{n+2}a_{j}\left (y\right )x^{n+j+1}; \\ \text{for}\;&i=1, \\ &\sum _{j\geq 0}jh_{n+1}a_{j}\left (y\right )x^{n+j}=\sum _{j\geq 0} \left (m-n+j-1\right )h_{n+1}a_{m-n+j-1}\left (y\right )x^{m+j-1} \\ &+\sum _{j=0}^{m-n-2}jh_{n+1}a_{j}\left (y\right )x^{n+j}; \\ \text{for}\;&i=0, \\ &\sum _{j\geq 0}jh_{n}a_{j}\left (y\right )x^{n+j-1}=\sum _{j\geq 0} \left (m-n+j\right )h_{n}a_{m-n+j}\left (y\right )x^{m+j-1}\\ & + \sum _{j=0}^{m-n-1}jh_{n}a_{j} \left (y\right )x^{n+j-1}; \\ \text{and}\;&\sum _{j\geq 0}g\left (y\right )a'_{j}\left (y\right )x^{j}= \sum _{j\geq 0}g\left (y\right )a'_{m+j-1}\left (y\right )x^{m+j-1}\\ & + \sum _{j=0}^{m-2}g\left (y\right )a'_{j}\left (y\right )x^{j}. \end{aligned}$$

Then equating the coefficients of \(x^{j}\) in (11) we get the equations that \(a_{j}\left (y\right )\) must satisfy:

$$ \begin{aligned} &a'_{j}\left (y\right )=0\quad \text{for}\;j=0,\ldots ,n-1; \\ &a'_{j}\left (y\right )=-\frac{f\left (y\right )}{g\left (y\right )} \sum _{i=1}^{j-n+1}ih_{j-i+1}a_{i}\left (y\right )\quad \text{for}\;j=n, \ldots ,m-2; \\ &a'_{j}\left (y\right )=-\frac{f\left (y\right )}{g\left (y\right )} \sum _{i=0}^{m-n}\left (j+i-m+1\right )h_{m-i}f\left (y\right )a_{j+i-m+1} \left (y\right ) \quad \text{for}\;j\geq m-1. \end{aligned} $$
(12)

Remark 7

Note that \(a_{0}\left (y\right )\) is a constant. In the following we can assume \(a_{0}\left (y\right )=0\), because a first integral does not depend on the sum of an additional constant.

The solutions of equations (12) are characterized by the following two lemmas.

Lemma 8

Let \(h\left (x\right )=\sum _{i=0}^{m-n}h_{n+i}x^{n+i}\) with \(h_{n+i}\in \mathbb{C}\) and \(h_{m}h_{n}\neq 0\). Assume that \(n=1\) and that the differential polynomial system (1) has a generalized analytic first integral (10). Then the following statements hold.

  1. (a)

    There exist polynomials \(F_{j}\left (u\right )\) with \(\operatorname{deg}F_{j}=j\) and \(F_{j}\left (0\right )=0\) such that

    $$ a_{j}\left (y\right )=F_{j}\left (\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy\right )\right ) \quad \textit{for all $j\in \mathbb{N}$.} $$
  2. (b)

    The polynomial \(g\left (y\right )\) is square-free and \(\deg f < \deg g\).

Proof

\((a)\) When \(n=1\) equations (12) can be rewritten as

$$\begin{aligned} &a'_{j}\left (y\right )=-jh_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j}\left (y\right )- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=1}^{j-1}ih_{j-i+1}a_{i} \left (y\right ) \quad \text{for}\;j=1,\ldots ,m-2, \end{aligned}$$
(13)

and

$$\begin{aligned} &a'_{j}\left (y\right )=-jh_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j}\left (y\right )- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=0}^{m-2}\left (j+i-m+1 \right )h_{m-i}f\left (y\right )a_{j+i-m+1}\left (y\right ), \end{aligned}$$
(14)

for \(j\geq m-1\).

For \(m=2\) we only need to study equation (14) that is

$$\begin{aligned} &a'_{j}\left (y\right )=-jh_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j}\left (y\right )- \left (j-1\right )h_{2}\frac{f\left (y\right )}{g\left (y\right )}a_{j-1} \left (y\right ), \end{aligned}$$
(15)

with \(j\geq 1\).

When \(j=1\) the solution of equation (15) is

$$\begin{aligned} &a_{1}\left (y\right )=C_{1}\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy\right ), \end{aligned}$$
(16)

where \(C_{1}\) is an integration constant. Obviously \(F_{1}\left (u\right )=C_{1}u\). Hence for \(j=1\) statement \((a)\) holds.

Assume that there exists polynomial \(F_{j}\left (u\right )\) with \(\text{deg}\;F_{j}=j\) and \(F_{j}\left (0\right )=0\) such that

$$ a_{j}\left (y\right )=F_{j}\left (\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy\right )\right ). $$

By the induction hypothesis and equation (15) we have

$$\begin{aligned} &a'_{j+1}\left (y\right )=-\left (j+1\right )h_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j+1}\left (y\right )-jh_{2} \frac{f\left (y\right )}{g\left (y\right )} F_{j}\left (\exp \left (-h_{1} \int \frac{f\left (y\right )}{g\left (y\right )} dy\right )\right ). \end{aligned}$$
(17)

The solution of the linear differential equation (17) is

$$\begin{aligned} a_{j+1}\left (y\right )=&\exp \left (-\left (j+1\right )h_{1} \int \frac{f\left (y\right )}{g\left (y\right )}dy\right ) \\ &\times \Big(C_{j+1}-jh_{2}\int \frac{f\left (y\right )}{g\left (y\right )}\exp \left ( \left (j+1\right )h_{1}\int \frac{f\left (y\right )}{g\left (y\right )}dy\right ) \\ &\times F_{j}\left ( \exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy \right )\right )dy\Big). \end{aligned}$$
(18)

Let \(u=\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy \right )\). Then

$$\begin{aligned} &\frac{du}{u}=-h_{1} \frac{f\left (y\right )}{g\left (y\right )}dy. \end{aligned}$$
(19)

So equation (18) can be written as

$$\begin{aligned} &a_{j+1}\left (y\right )=F_{j+1}\left (u\right )=u^{j+1}\left (C_{j+1}+ \frac{jh_{2}}{h_{1}}\int \frac{1}{u^{j+2}}F_{j}\left (u\right )du \right ). \end{aligned}$$
(20)

Using the induction hypothesis \(\text{deg}\;F_{j}=j\) and \(F_{j}\left (0\right )=0\), we get \(\text{deg}\;F_{j+1}=j+1\) and \(F_{j+1}\left (0\right )=0\). The induction is proved and statement \((a)\) follows for \(m=2\).

For \(m\geq 3\) we need to consider equations (13) and (14), that is

$$\begin{aligned} &a'_{j}\left (y\right )=-jh_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j}\left (y\right )- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=1}^{j-1}ih_{j+1-i}a_{i} \left (y\right ) \quad \text{for}\;j=1,\ldots ,m-2, \end{aligned}$$
(21)

and

$$\begin{aligned} &a'_{j}\left (y\right )=-jh_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j}\left (y\right )- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=0}^{m-2}\left (j+i-m+1 \right )h_{m-i}a_{j+i-m+1}\left (y\right ), \end{aligned}$$
(22)

for \(j\geq m-1\).

For \(j=1\) equation (21) becomes

$$\begin{aligned} &\frac{a'_{1}\left (y\right )}{a_{1}\left (y\right )}=-h_{1} \frac{f\left (y\right )}{g\left (y\right )}. \end{aligned}$$
(23)

It is easy to get that

$$ a_{1}\left (y\right )=C_{1}\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy\right ), $$

where \(C_{1}\) is an integration constant. Let \(F_{1}\left (u\right )=C_{1}u\). So statement \((a)\) holds for \(j=1\).

Assume that for \(j=1,\ldots ,l\) there exist polynomials \(F_{j}\left (u\right )\) with \(\text{deg}\;F_{j}=j\) such that

$$ a_{j}\left (y\right )=F_{j}\left (\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy\right )\right ). $$

Next we consider \(j=l+1\). If \(l+1\leq m-2\), then

$$\begin{aligned} &a'_{l+1}\left (y\right )=-(l+1)h_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{l+1}\left (y\right )- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=1}^{l}ih_{l+2-i}F_{i} \left (u\right ), \end{aligned}$$
(24)

with \(u=\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy \right )\). The solution of the linear differential equation (24) is

$$ \begin{aligned} &a_{l+1}\left (y\right )=u^{l+1}\left (C_{l+1}-\sum _{i=1}^{l}ih_{l+2-i} \int \frac{f\left (y\right )}{g\left (y\right )} \frac{F_{i}\left (u\right )}{u^{l+1}}dy\right ), \end{aligned} $$
(25)

with \(u=\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy \right )\). From equation (19) it follows that

$$ a_{l+1}\left (y\right )=F_{l+1}\left (u\right )=u^{l+1}\left (C_{l+1}+ \sum _{i=1}^{l}\frac{ih_{l+2-i}}{h_{1}}\int \frac{F_{i}\left (u\right )}{u^{l+2}}du\right ). $$

By the induction hypothesis \(\text{deg}\;F_{j}=j\) and \(F_{j}\left (0\right )=0\) for \(j=1,\ldots ,l\), we obtain \(\text{deg}\;F_{l+1}=l+1\) and \(F_{l+1}\left (0\right )=0\).

If \(l+1\geq m-1\), then

$$\begin{aligned} &a'_{l+1}\left (y\right )=-(l+1)h_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{l+1}\left (y\right ) - \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=0}^{m-2}\left (l+i-m+2 \right )h_{m-i}F_{l+i-m+2}\left (u\right ), \end{aligned}$$
(26)

with \(u=\exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy \right )\). By the same arguments as above one can get that

$$\begin{aligned} &a_{l+1}\left (y\right )=F_{l+1}\left (u\right )=u^{l+1}\left (C_{l+1}+ \sum _{i=0}^{m-2}\frac{\left (l+i-m+2\right )h_{m-i}}{h_{1}}\int \frac{F_{l+i-m+2}\left (u\right )}{u^{l+1}}du\right ). \end{aligned}$$
(27)

Applying the induction hypothesis \(\text{deg}\;F_{j}=j\) and \(F_{j}\left (0\right )=0\) for \(j=1,\ldots ,l\), we have \(\text{deg}\;F_{l+1}=l+1\) and \(F_{l+1}\left (0\right )=0\). The proof of statement \((a)\) is done.

\((b)\) Let \(a_{j}\left (y\right )=\text{constant}=C_{j}\) for \(j\in \mathbb{N}\). From statement \((a)\) we know that there exists a polynomial \(F_{j}\left (u\right )\) such that

$$ a_{j}\left (y\right )=F_{j}\left (u\right )=C_{j}\;\text{with}\;u= \exp \left (-h_{1}\int \frac{f\left (y\right )}{g\left (y\right )} dy \right )\;\text{and}\;F_{j}\left (0\right )=0. $$

Thus \(C_{j}=0\). Since the first integral \(H\left (x,y\right )\) is a non-locally constant function, there exists a positive integer \(j_{0}\) such that \(a_{j_{0}}\left (y\right )\) is not a constant and \(a_{i}\left (y\right )=0\) for \(i=1,\ldots ,j_{0}-1\). Using equations (13) and (14) we have

$$ a'_{j_{0}}\left (y\right )=-j_{0}h_{1} \frac{f\left (y\right )}{g\left (y\right )}a_{j_{0}}\left (y\right ). $$

Consequently

$$\begin{aligned} &a_{j_{0}}\left (y\right )=C_{j_{0}}\exp \left (-j_{0}h_{1}\int \frac{f\left (y\right )}{g\left (y\right )}\right ), \end{aligned}$$
(28)

with constant \(C_{j_{0}}\neq 0\). From Lemma 6 we get that \(a_{j_{0}}\left (y\right )\) if and only if \(f\left (y\right )/g\left (y\right )\) is a square-free rational function. So \(g\left (y\right )\) is square-free and \(\text{deg}\;f<\text{deg}\;g\). This completes the proof of this lemma. □

Lemma 9

Let \(h\left (x\right )=\sum _{i=0}^{m-n}h_{n+i}x^{n+i}\) with \(h_{n+i}\in \mathbb{C}\) and \(h_{m}h_{n}\neq 0\). Assume that \(n\geq 2\) and that the polynomial differential system (1) has a generalized analytic first integral (10), and \(\alpha _{1},\ldots ,\alpha _{k}\) are the different roots of the polynomial \(g\left (y\right )\). The following statements hold.

  1. (a)

    There exist polynomials \(F_{j}\left (u\right )\) such that

    $$ a_{j}\left (y\right )=F_{j}\left (\int \frac{f\left (y\right )}{g\left (y\right )} dy\right ), $$

    for \(j\geq n\), and \(a_{j}\left (y\right )\) are constants for \(j=1,\ldots ,n-1\).

  2. (b)

    Then \(\operatorname{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{i} \right ]=0\) for all \(i=1,\ldots ,k\).

Proof

\((a)\) From equations (12) we have that

$$\begin{aligned} &a'_{j}\left (y\right )=0\quad \text{for}\;j=1,\ldots ,n-1; \end{aligned}$$
(29)
$$\begin{aligned} &a'_{j}\left (y\right )=-\frac{f\left (y\right )}{g\left (y\right )} \sum _{i=1}^{j-n+1}ih_{j-i+1}a_{i}\left (y\right )\quad \text{for}\;j=n,n+1, \ldots ,m-2; \end{aligned}$$
(30)

and

$$\begin{aligned} &a'_{j}\left (y\right )=-\frac{f\left (y\right )}{g\left (y\right )} \sum _{i=0}^{m-n}\left (j+i-m+1\right )h_{m-i}a_{j+i-m+1}\left (y \right )\quad \text{for}\;j\geq m-1. \end{aligned}$$
(31)

Then \(a_{j}\left (y\right )=\text{constant}=C_{j}\) for \(j=1,\ldots , n-1\).

For \(j=n\) equation (30) can be written as

$$ a'_{n}\left (y\right )=-h_{n} \frac{f\left (y\right )}{g\left (y\right )}a_{1}\left (y\right )=-h_{n}C_{1} \frac{f\left (y\right )}{g\left (y\right )}. $$

We get

$$ a_{n}\left (y\right )=-h_{n}C_{1}\int \frac{f\left (y\right )}{g\left (y\right )}dy+C_{n}, $$

where \(C_{n}\) is an integration constant. Let \(F_{n}\left (u\right )=-h_{n}C_{1}u+C_{n}\). Thus statement \((a)\) holds for \(j=n\).

The constants \(a_{j}\left (y\right )=C_{j}\) for \(j=1,\ldots ,n-1\) can be regarded as polynomials of degree 0. Assume that for \(j=1,\ldots ,l\) there exist polynomials \(F_{j}\left (u\right )\) such that

$$ a_{j}\left (y\right )=F_{j}\left (\int \frac{f\left (y\right )}{g\left (y\right )}dy\right ). $$

If \(n \leq l+1\leq m-2\), then function \(a_{l+1}\left (y\right )\) satisfy

$$\begin{aligned} &a'_{l+1}\left (y\right )=- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=1}^{l-n+2}ih_{l-i+2}F_{i} \left (\int \frac{f\left (y\right )}{g\left (y\right )}dy\right ). \end{aligned}$$
(32)

Let \(u=\int \left (f\left (y\right )/g\left (y\right )\right )dy\). Note that \(du= \left (f\left (y\right )/g\left (y\right ) \right )dy\). Therefore

$$ \textstyle\begin{array}{rl} a_{l+1}\left (y\right )=&F_{l+1}\left (u\right ) \\ =&\displaystyle {-\sum _{i=1}^{l-n+2}ih_{l-i+2}\int \frac{f\left (y\right )}{g\left (y\right )} F_{i}\left (\int \frac{f\left (y\right )}{g\left (y\right )}dy\right )dy} \\ =&\displaystyle {-\sum _{i=1}^{l-n+2}ih_{l-i+2}\int F_{i}\left (u \right )du}. \end{array} $$

If \(l+1\geq m-1\), then

$$\begin{aligned} &a'_{l+1}\left (y\right )=- \frac{f\left (y\right )}{g\left (y\right )}\sum _{i=0}^{m-n}\left (l+i-m+2 \right )h_{m-i}F_{l+i-m+2}\left (u\right ). \end{aligned}$$

Using similar arguments we obtain

$$ a_{l+1}\left (y\right )=F_{l+1}\left (u\right )=-\sum _{i=0}^{m-n} \left (l+i-m+2\right )h_{m-i}\int F_{l+i-m+2}\left (u\right ) du. $$

Therefore statement \((a)\) is proved.

\((b)\) Suppose that \(a_{j}\left (y\right )=\text{constant}=C_{j}\) for all \(j\geq n\). Then the first integral \(H\left (x,y\right )\) is independent of the variable \(y\). This implies that \(\dot{x}=0\), which is a contradiction. Therefore there exists a positive integer \(j_{0}\geq n\) such that \(a_{j_{0}}\left (y\right )\) is not a constant and \(a_{i}\left (y\right )=\text{constant}=C_{i}\) for \(i=1,\ldots ,j_{0}-1\). From equations (30) and (31) we obtain that

$$\begin{aligned} &a'_{j_{0}}\left (y\right )=C \frac{f\left (y\right )}{g\left (y\right )}, \end{aligned}$$
(33)

where \(C=-\sum _{i=1}^{j-n+1}ih_{j-i+1}C_{i}\) or \(\sum _{i=0}^{m-n}\left (j+i-m+1\right )h_{m-i}C_{j+i-m+1}\). Hence

$$\begin{aligned} &a_{j_{0}}\left (y\right )=C\int \frac{f\left (y\right )}{g\left (y\right )}dy+C_{j_{0}}, \end{aligned}$$
(34)

with constant \(C\neq 0\). Since \(a_{j_{0}}\left (y\right )\) is a product function, by Lemma 6, we get that

$$ \frac{C}{C\int \frac{f\left (y\right )}{g\left (y\right )}dy+C_{j_{0}}} \frac{f\left (y\right )}{g\left (y\right )} $$

is a square-free rational function. This implies that

$$\begin{aligned} \int \frac{f(y)}{g(y)}dy \end{aligned}$$
(35)

is a rational function.

We know that there exist two polynomials \(p\left (y\right ),r\left (y\right )\in \mathbb{C}\left [y\right ]\) such that

$$\begin{aligned} &f\left (y\right )=p\left (y\right )g\left (y\right )+r\left (y \right )\quad \text{and}\quad \text{deg}\;r< \text{deg}\;g. \end{aligned}$$

The polynomial \(r\left (y\right )\) cannot be zero due to the fact that \(f\left (y\right )\) and \(g\left (y\right )\) are coprime. Consequently

$$\begin{aligned} &\int \frac{f\left (y\right )}{g\left (y\right )} dy =Q\left (y \right )+\int \frac{r\left (y\right )}{g\left (y\right )} dy, \end{aligned}$$
(36)

with \(Q'\left (y\right )=p\left (y\right )\). Assume that \(\alpha _{1},\ldots ,\alpha _{k}\) are the distinct roots of \(g\left (y\right )\) with multiplicity \(n_{1},n_{2},\ldots ,n_{k}\), respectively. Using Lemma 5\(r\left (y\right )/g\left (y\right )\) can be expressed as

$$\begin{aligned} &\frac{r\left (y\right )}{g\left (y\right )}=\sum _{i=1}^{k}\sum _{j=1}^{n_{i}} \frac{c_{i,j}}{\left (y-\alpha _{i}\right )^{j}}, \end{aligned}$$
(37)

where \(c_{i,n_{i}}\neq 0\) for \(i=1,\ldots ,k\). Thus

$$\begin{aligned} &\int \frac{r\left (y\right )}{g\left (y\right )} dy=\ln \left ( \prod _{i=1}^{k}\left (y-\alpha _{i}\right )^{c_{i,1}}\right )+\sum _{i=1}^{k} \sum _{j=2}^{n_{i}}\int \frac{c_{i,j}}{\left (y-\alpha _{i}\right )^{j}} dy. \end{aligned}$$
(38)

Since equation (35) is a rational function and \(Q\left (y\right )\) (see equation (36)) is polynomial, equation (38) is also a rational function. Note that \(j\geq 2\) in equation (38). This implies that

$$ \int \frac{c_{i,j}}{\left (y-\alpha _{i}\right )^{j}} dy $$

is a rational function. Then \(c_{i,1}\) must be 0, that is \(\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{i} \right ]=0\) for all \(i=1,\ldots ,k\). The proof is done. □

3 Proofs of Theorems 1, 3 and 4

The main purpose of this section is to prove Theorems 1, 3 and 4.

Proof of Theorem 1

We claim that if \(h\left (x\right )\) simultaneously has simple roots and multiple roots, then system (1) has no generalized analytic first integral.

Let \(\beta _{1}\) and \(\beta _{2}\) be a simple root and a root of multiplicity \(n\) of \(h\left (x\right )\) with \(n\geq 2\), respectively. Assume that system (1) has a generalized analytic first integral. Doing the change of variables \(\left (x,y,t\right )\mapsto \left (x+\beta _{1},y,t\right )\), system (1) becomes

$$\begin{aligned} &\dot{x}=\tilde{h}\left (x\right )f\left (y\right ),\quad \dot{y}=g \left (y\right ), \end{aligned}$$
(39)

where \(\tilde{h}\left (x\right )=\sum _{i=1}^{m}\tilde{h}_{i}x^{i}\) with \(\tilde{h}_{i}\in \mathbb{C}\) and \(\tilde{h}_{m}\tilde{h}_{1}\neq 0\). Since system (1) has a generalized analytic first integral, system (39) also has a generalized analytic first integral. By Lemma 8 we get that \(g\left (y\right )\) is square-free and \(\text{deg}\;f <\text{deg}\;g\). This means that \(\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{i} \right ]\neq 0\) for all \(i=1,\ldots ,k\).

Under the transformation \(\left (x,y,t\right )\mapsto \left (x+\beta _{2},y,t\right )\) system (1) changes to

$$\begin{aligned} &\dot{x}=\bar{h}\left (x\right )f\left (y\right ),\quad \dot{y}=g \left (y\right ), \end{aligned}$$
(40)

where \(\bar{h}\left (x\right )=\sum _{i=n}^{m}\bar{h}_{i}x^{i}\) with \(\bar{h}_{i}\in \mathbb{C}\) and \(\bar{h}_{m}\bar{h}_{n} \neq 0\). From Lemma 9 it follows that

$$ \text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{i} \right ]=0 $$

for all \(i=1,\ldots ,k\). This is in contradiction with \(\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{i} \right ]\neq 0\) for all \(i=1,\ldots ,k\). So the claim is proved.

In summary, the polynomial \(h\left (x\right )\) is square-free or it has no simple roots. If \(h\left (x\right )\) is square-free, using Lemma 8, we obtain statement \((a)\). If \(h\left (x\right )\) has no simple roots, by Lemma 9, statement \((b)\) holds. This completes the proof of the theorem. □

Proof of Theorem 3

Doing the change of variables \(\left (x,y,t\right )\mapsto \left (\left (x-b\right )/a,y,t/a\right )\), system (1) becomes

$$\begin{aligned} &\dot{x}=x^{m}f\left (y\right ),\quad \dot{y}=\frac{1}{a}g\left (y \right ). \end{aligned}$$
(41)

\((a)\) From Theorem 2 it follows that statement \((a)\) holds.

\((b)\) Necessity. Using statement \((a)\) of Theorem 1 the necessity is obvious.

Sufficiency. It is sufficient to show that system (41) has a generalized analytic first integral. Assume that \(\alpha _{1},\ldots ,\alpha _{k}\) are the distinct roots of \(g\left (y\right )\) with multiplicity \(n_{1},n_{2},\ldots ,n_{k}\), respectively. There exist two polynomials \(p\left (y\right ),r\left (y\right )\in \mathbb{C}\left [y\right ]\) such that

$$\begin{aligned} &f\left (y\right )=p\left (y\right )g\left (y\right )+r\left (y \right )\quad \text{and}\quad \text{deg}\;r< \text{deg}\;g. \end{aligned}$$

The polynomial \(r\left (y\right )\) cannot be zero due to the fact that \(f\left (y\right )\) and \(g\left (y\right )\) are coprime.

By Lemma 5 we have

$$\begin{aligned} &\frac{f\left (y\right )}{g\left (y\right )}=p\left (y\right )+ \frac{r\left (y\right )}{g\left (y\right )}=p\left (y\right ) +\sum _{i=1}^{k} \sum _{j=1}^{n_{i}}\frac{c_{i,j}}{\left (y-\alpha _{i}\right )^{j}}, \end{aligned}$$
(42)

where \(c_{i,n_{i}}\neq 0\) for \(i=1,\ldots ,k\). Since \(\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{i} \right ]=0\) that is \(c_{i,1}=0\) for all \(i=1,\ldots ,k\), we obtain

$$\begin{aligned} &P\left (y\right ):=\int \frac{f\left (y\right )}{g\left (y\right )}dy= \int p\left (y\right )dy+\sum _{i=1}^{k}\sum _{j=2}^{n_{i}}\int \frac{c_{i,j}}{\left (y-\alpha _{i}\right )^{j}}dy. \end{aligned}$$
(43)

Note that \(j\geq 2\) in equation (43). Thus \(P\left (y\right )\) is a rational function, that is, a product function. Now we show that

$$\begin{aligned} &H\left (x,y\right )= \frac{\left (m-1\right )x^{m-1}}{1+a\left (m-1\right )x^{m-1}P\left (y\right )} \end{aligned}$$
(44)

is a generalized analytic first integral of system (41). Doing simple computations we have

$$ \frac{\partial H}{\partial x}= \frac{\left (m-1\right )^{2}x^{m-2}}{\left (1+a\left (m-1\right )x^{m-1}P\left (y\right )\right )^{2}} \quad \text{and}\quad \frac{\partial H}{\partial y}=- \frac{a\left (m-1\right )^{2}x^{2m-2}}{\left (1+a\left (m-1\right )x^{m-1}P\left (y\right )\right )^{2}} \frac{f\left (y\right )}{g\left (y\right )}. $$

Therefore

$$ \mathcal{X}H=x^{m}f\left (y\right )\frac{\partial H}{\partial x}+ \frac{1}{a}g\left (y\right )\frac{\partial H}{\partial y}=0. $$

Moreover \(H\left (x,y\right )\) can be written as a power series in \(x\)

$$ H\left (x,y\right )= \frac{\left (m-1\right )x^{m-1}}{1-a\left (1-m\right )x^{m-1}P\left (y\right )}= \left (m-1\right )x^{m-1}\sum _{j\geq 0} a^{j}\left (1-m\right )^{j}P^{j} \left (y\right )x^{\left (m-1\right )j}. $$

This completes the proof of the theorem. □

Proof of Theorem 4

Necessity. We claim that \(h\left (x\right )\) is square-free.

Let \(\beta _{1},\ldots ,\beta _{l}\) be different roots of the polynomial \(h\left (x\right )\). Suppose that \(\beta \) is an arbitrary root of the polynomial \(h\left (x\right )\) with multiplicity \(n\). By changing the variables \(\left (x,y,t\right )\mapsto \left (x+\beta ,y,t\right )\), system (1) is equivalent to

$$\begin{aligned} &\dot{x}=\tilde{h}\left (x\right )f\left (y\right ),\quad \dot{y}=g \left (y\right ), \end{aligned}$$
(45)

where \(\tilde{h}\left (x\right )=\sum _{i=n}^{m}\tilde{h}_{i}x^{i}\) with \(\tilde{h}_{i}\in \mathbb{C}\) and \(\tilde{h}_{m}\tilde{h}_{n}\neq 0\). Note that \(\tilde{h}_{n}=h^{(n)}(\beta )/n!\). Since system (1) has a polynomial first integral, system (45) also has a polynomial first integral, that is

$$\begin{aligned} &H\left (x,y\right )=\sum _{j\geq 0}a_{j}\left (y\right )x^{j}, \end{aligned}$$
(46)

where \(a_{j}\left (y\right )\) are polynomials. Obviously \(H\left (x,y\right )\) is a generalized analytic first integral. From the proof of Lemmas 8 and 9 we know that there exists a positive integer \(j_{0}\) such that \(a_{j_{0}}\left (y\right )\) is not a constant, and \(a_{i}\left (y\right )=\text{constant}=C_{i}\) for \(i=1,\ldots ,j_{0}-1\).

Assume that \(n\geq 2\). From the proof of statement \((b)\) of Lemma 9, we get

$$\begin{aligned} &a_{j_{0}}\left (y\right )=C\int \frac{f\left (y\right )}{g\left (y\right )}dy+C_{j_{0}}, \end{aligned}$$
(47)

with constant \(C\neq 0\) (see equation (34)). By equation (38) \(a_{j_{0}}\left (y\right )\) is not a polynomial. Thus \(\beta \) is a simple root of \(h\left (x\right )\), that is \(n=1\). Using Theorem 1 we obtain that the polynomials \(h\left (x\right )\) and \(g\left (y\right )\) are square-free, and \(\text{deg}\;f<\text{deg}\;g\). Hence the claim is proved.

From the proof of statement \((b)\) of Lemma 8 we have

$$\begin{aligned} &a_{j_{0}}\left (y\right )=C_{j_{0}}\exp \left (-j_{0}\tilde{h}_{1} \int \frac{f\left (y\right )}{g\left (y\right )}\right ), \end{aligned}$$
(48)

with \(\tilde{h}_{1}=h'\left (\beta \right )\) and the constant \(C_{j_{0}}\neq 0\) (see equation (28)).

Applying Lemma 5\(f\left (y\right )/g\left (y\right )\) can be expressed as

$$\begin{aligned} &\frac{f\left (y\right )}{g\left (y\right )}=\sum _{j=1}^{k} \frac{\mu _{j}}{y-\alpha _{j}}, \end{aligned}$$
(49)

where \(\mu _{j}=\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{j} \right ]\) for \(j=1,\ldots ,k\). Therefore

$$\begin{aligned} &a_{j_{0}}\left (y\right )=C_{j_{0}}\prod _{j=1}^{k}\left (y-\alpha _{i} \right )^{-j_{0}\tilde{h}_{1}\mu _{j}}. \end{aligned}$$
(50)

Since \(a_{j_{0}}\left (y\right )\) is a polynomial we have \(\tilde{h}_{1}\mu _{j}\in \mathbb{Q}^{-}\) for all \(j=1,\ldots ,k\). Note that \(\beta \) is an arbitrary root of the polynomial \(h\left (x\right )\). Thus

$$\begin{aligned} &h'\left (\beta _{i}\right )\cdot \text{Res}\left [f\left (y\right )/g \left (y\right ),\alpha _{j}\right ]\in \mathbb{Q}^{-}\;\text{for}\;i=1, \ldots ,l \quad \text{and}\quad j=1,\ldots ,k. \end{aligned}$$
(51)

This means that \(h'\left (\beta _{1}\right )/h'\left (\beta _{i}\right )\in \mathbb{Q}^{+}\) for \(i=1,\ldots ,l\).

Assume that \(l\geq 2\). Using statement \((b)\) of Lemma 5\(1/h\left (x\right )\) can be written as

$$ \frac{1}{h\left (x\right )}=\sum _{i=1}^{l}\frac{t_{i}}{x-\beta _{i}}, $$

with \(t_{i}=\text{Res}\left [1/h\left (x\right ),\beta _{i}\right ]=1/h' \left (\beta _{i}\right )\neq 0\). From equation (7) we obtain

$$\begin{aligned} \sum _{i=1}^{l}t_{i}=\sum _{i=1}^{l} \frac{1}{h'\left (\beta _{i}\right )}=0. \end{aligned}$$
(52)

One can get

$$ \sum _{i=1}^{l} \frac{h'\left (\beta _{1}\right )}{h'\left (\beta _{i}\right )}=0, $$

which is in contradiction with \(h'\left (\beta _{1}\right )/h'\left (\beta _{i}\right )\in \mathbb{Q}^{+}\) for \(i=1,\ldots ,l\). So \(l=1\), that is \(h\left (x\right )=ax+b\) with \(a\in \mathbb{C}\setminus \{0\}\). Then equation (51) becomes

$$ a\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{j} \right ]\in \mathbb{Q}^{-}\;\text{for}\;j=1,\ldots ,k. $$

This proves the necessity.

Sufficiency. Let \(\mu _{j}=\text{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{j} \right ]\) and consider

$$\begin{aligned} &\widetilde{H}\left (x,y\right )=\left (x+\frac{b}{a}\right )^{ \frac{1}{a}}\left (\prod _{j=1}^{k}\left (y-\alpha _{j}\right )^{- \mu _{j}}\right ). \end{aligned}$$
(53)

Since \(a\mu _{j}\in \mathbb{Q}^{-}\) there exists a positive integer \(N\) such that

$$\begin{aligned} &H\left (x,y\right )=\left (\widetilde{H}\left (x,y\right )\right )^{aN}= \left (x+\frac{b}{a}\right )^{N} \left (\prod _{j=1}^{k}\left (y- \alpha _{j}\right )^{-\mu _{j}aN}\right ) \end{aligned}$$
(54)

is a polynomial. Next we show that polynomial (54) is a first integral of system (1). In fact it is sufficient to prove that \(\widetilde{H}\left (x,y\right )\) is a first integral of system (1).

Straightforward computations show that

$$\begin{aligned} &\frac{\partial \widetilde{H}}{\partial x}= \frac{\widetilde{H}\left (x,y\right )}{ax+b}, \end{aligned}$$
(55)

and

$$\begin{aligned} &\frac{\partial \widetilde{H}}{\partial y}=-\widetilde{H}\left (x,y \right )\left (\sum _{j=1}^{k}\frac{\mu _{j}}{y-\alpha _{j}}\right ). \end{aligned}$$
(56)

The polynomial \(g\left (y\right )\) is square-free with \(\text{deg}\;f<\text{deg}\;g\). Using Lemma 5 we have

$$\begin{aligned} & \frac{f\left (y\right )}{g\left (y\right )}=\sum _{j=1}^{k} \frac{\mu _{j}}{y-\alpha _{j}}. \end{aligned}$$
(57)

Equation (56) can be written as

$$ \frac{\partial \widetilde{H}}{\partial y}=-\widetilde{H}\left (x,y \right )\frac{f\left (y\right )}{g\left (y\right )}. $$

Thus

$$ \mathcal{X}\widetilde{H}=\left (ax+b\right )f\left (y\right ) \frac{\partial \widetilde{H}}{\partial x}+g\left (y\right ) \frac{\partial \widetilde{H}}{\partial y}=0. $$

That is \(\widetilde{H}\left (x,y\right )\) is a first integral of system (1). This completes the proof of the theorem. □

4 Examples

In this section we present some applications of our results.

Example 10

Consider the differential system

$$\begin{aligned} &\dot{x}=\left (x-1\right )\left (x-2\right )^{2}y,\quad \dot{y}=y+1. \end{aligned}$$
(58)

It has a first integral

$$ H\left (x,y\right )=\frac{x-2}{\left (x-1\right )\left (y+1\right )} \exp \left (y+\frac{1}{x-2}\right ).$$

By Theorem 1 system (58) has no generalized analytic first integral, because \(h\left (x\right )=\left (x-1\right )\left (x-2\right )^{2} \) simultaneously has simple roots and multiple roots.

Example 11

Consider the differential system

$$\begin{aligned} &\dot{x}=\left (2x-1\right )^{m}\left (y^{3}-8y^{2}+29y-26\right ), \quad \dot{y}=(y-3)^{3}(y+1)^{2}, \end{aligned}$$
(59)

with \(m\in \mathbb{N}\) and \(m\geq 2\). For this system we have \(f\left (y\right )=y^{3}-8y^{2}+29y-26\), \(g\left (y\right )=(y-3)^{3}(y+1)^{2}\), \(\alpha _{1}=-1\) and \(\alpha _{2}=3\). So \(\textit{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{1} \right ]=\textit{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{2} \right ]=0\). Applying Theorem 3system (59) has the generalized analytic first integral (see equation (44))

$$ H\left (x,y\right )= \frac{2(m-1)(y-1)\left (y-3\right )^{2}\left (2x-1\right )^{m-1}}{(y+1)\left (y-3\right )^{2}-(m-1)\left (2y^{2}-11y+19\right )\left (2x-1\right )^{m-1}}.$$

Example 12

Consider the differential system

$$\begin{aligned} &\dot{x}=\left (5x-1\right )\left (3\sqrt[3]{3}+2\sqrt{2}-5y\right ), \quad \dot{y}=6\left (y-\sqrt{2}\right )\left (y-\sqrt[3]{3}\right ). \end{aligned}$$
(60)

Using the notations of Theorem 4we get that \(g\left (y\right )=6\left (y-\sqrt{2}\right )\left (y-\sqrt[3]{3} \right )\) is square-free, \(\alpha _{1}=\sqrt{2}\), \(\alpha _{2}=\sqrt[3]{3}\), \(h\left (x\right )=5x-1\) and \(f\left (y\right )=3\sqrt[3]{3}+2\sqrt{2}-5y\). For this system we have

$$ 5\textit{Res}\left [f\left (y\right )/g\left (y\right ),\alpha _{1} \right ]=-\frac{5}{2}\quad \textit{and}\quad 5\textit{Res}\left [f\left (y \right )/g\left (y\right ),\alpha _{2}\right ]=-\frac{5}{3}.$$

By Theorem 4system (60) has the polynomial first integral

$$ H\left (x,y\right )=\left (x-\frac{1}{5}\right )^{6}\left (y-\sqrt{2} \right )^{15}\left (y-\sqrt[3]{3}\right )^{10}.$$