1 Introduction and statement of main results

Real nonlinear ordinary differential systems are used to model a wide range ofprocesses practically in all fields of science, from biology and chemistry to economy, physics and engineering. The existence of first integrals of differential systems defined on \(\mathbb {R}^n\) is important for two main reasons. First, they make easier the characterization of the phase portrait of the system. Secondly, their existence allows reducing the dimension of the system by its number of independent first integrals, which in many cases makes easier the analysis. In our terminology, a system is integrable if it has \(n-1\) independent first integrals if the space has dimension n. Therefore the methods to detect the presence of first integrals and find their explicit form are extremely important in the qualitative theory of differential equations.

In \(\mathbb {R}^2\) first integrals are easily found for Hamiltonians vector fields. If the integrable vector fields in \(\mathbb {R}^2\) are not Hamiltonian, various techniques have been developed for analysing the existence of first integrals, such as the Noether symmetries [32], generalized symmetries [25], Darboux theory of integrability [7], or the Lie symmetries [12, 26], these techniques have been extended to \(\mathbb {R}^n\). In fact, Emmy Noether’s theorems represent a relevant example of the interdisciplinary character acquired by the problem of finding first integrals. Roughly speaking stating that any physical conservation law has its associated symmetry, one establishes a connection between mechanics, Lie algebra and differential equations. Other contributions to this problem are represented by the Painlevé analysis [1], the use of Lax pairs [15], or the direct method [10, 11], to cite only few of them.

We are especially interested in the Darboux theory of integrability for real polynomial vector fields. This theory provides a method of constructing first integrals of polynomial vector fields, based on the number of invariant algebraic hypersurfaces that they have. Since its publication in 1878, the method originally developed by Darboux, has been extended and/or refined by many authors both in \(\mathbb {R}^2\) [2,3,4,5, 7, 9, 14, 16, 23, 28,29,30,31, 33,34,36] and \(\mathbb {R}^n\) [17, 18, 20,21,22, 24]. The first objective of this paper is to extend the Darboux theory of integrability of the real polynomial vector fields in the n-dimensional torus \(\mathbb {T}^n\), and to study the maximum number of invariant parallels and meridians that such polynomial vector fields can have in function of their degree.

Before stating our results, we need some preliminary definitions for the hypersurfaces that we are dealing with. First we give the general introductory notions valid for the application of the Darboux theory of integrability on any smooth hypersurfaces; then we will focus on the n-dimensional torus \(\mathbb {T}^n\) and on its invariant meridians and parallels.

Let \(G :\mathbb {R}^{n+1} \rightarrow \mathbb {R}\) be a \(C^1\) map. A hypersurface

$$\begin{aligned} \Omega = \bigl \{(x_1,\ldots , x_{n+1}) \in \mathbb {R}^{n+1}: G(x_1,\ldots , x_{n+1}) = 0\bigr \} \end{aligned}$$

is regular if the gradient \(\nabla G\) of G is not equal to zero on \(\Omega \). Of course, if \(\Omega \) is regular, then it is smooth. We say that a hypersurface \(\Omega \) is algebraic if G is an irreducible polynomial. If the degree of the polynomial G is d, then we say that the hypersurface \(\Omega \) is algebraic of degree d.

A polynomial vector field \(X=(P_1,\ldots ,P_{n+1})\) on a regular hypersurface \(\Omega \) (or simply a polynomial vector field on \(\Omega \)) is a polynomial vector field X in \(\mathbb {R}^{n+1}\) satisfying the following properties:

$$\begin{aligned} (P_1, \ldots , P_{n+1}) \hspace{1.111pt}{\cdot }\hspace{1.111pt}\nabla G= 0 \;\; \text {on the points of}\,\,\, \Omega , \end{aligned}$$

where the dot denotes the inner product of two vectors in \(\mathbb {R}^{n+1}\). If the polynomial vector field X in \(\mathbb {R}^{n+1}\) has degree \(m=\textrm{max}\hspace{0.55542pt}\{{\deg P_1},\ldots ,\deg P_{n+1}\}\), then we say that the vector field X on \(\Omega \) is of degree m.

Let \(f = f(x_1, \ldots ,x_{n+1}) \in \mathbb {C}\hspace{0.55542pt}[x_1,\dots , x_{n+1}]\). We say that the algebraic hypersurface \(\{f = 0\} \cap \Omega \subset \mathbb {R}^{n+1}\) is invariant by the polynomial vector field X on \(\Omega \) (or simply an invariant algebraic hypersurface on \(\Omega \)) if it satisfies

  1. (a)

    There exists a polynomial \(k \in \mathbb {C}\hspace{0.55542pt}[x_1, \ldots ,x_{n+1}]\) such that

    $$\begin{aligned} X f =\sum _{i=1}^{n+1} P_i \hspace{0.55542pt}\frac{\partial f}{\partial x_i} = k f \quad \text {on}\;\; \Omega . \end{aligned}$$

    The polynomial \(k= k(x_1, \ldots ,x_{n+1}) \in \mathbb {C}\hspace{0.55542pt}[x_1, \ldots ,x_{n+1}]\) is called the cofactor of \(f = 0\) on \(\Omega \).

  2. (b)

    The two hypersurfaces \(f = 0\) and \(\Omega \) have transversal intersection, i.e. the vectors \(\nabla G\) and \(\nabla f\) are independent in all the points of the hypersurface \(\{f = 0\} \cap \Omega \).

Clearly a vector field X on \(\Omega \) for which \(f=0\) is an invariant algebraic hypersurface is tangent to the algebraic hypersurface \(\{f = 0\} \cap \Omega \). So the hypersurface \(\{f = 0\} \cap \Omega \) is formed by orbits of the vector field X. This explains why we say that the algebraic hypersurface \(\{f = 0\} \cap \Omega \) is invariant by the flow of the vector field X.

An exponential factor \(F = F(x_1,\ldots ,x_{n+1})\) of a polynomial vector field X of degree m on the regular hypersurface \(\Omega \) is an exponential function of the form \(\exp \hspace{0.55542pt}(g/h)\) with g and h polynomials in \(\mathbb {C}\hspace{0.55542pt}[x_1, \ldots ,x_{n+1}]\) satisfying \(XF = LF\) on \(\Omega \) for some \(L \in \mathbb {C}_{m-1}[x_1, \ldots ,x_{n+1}]\) of degree at most \(m-1\).

Let f and g be two polynomials of \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\) and let \(\Omega = \{G = 0\}\) be a regular algebraic hypersurface in \(\mathbb {R}^{n+1}\) of degree d. We say that f and g are related, \(f \sim g\), if either \(f/g =\textrm{constant}\) or \(f-g =h G\) for some polynomial h. That is, \(\sim \) is an equivalence relation in \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\); it splits \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\) into equivalence classes defined in the following way. Given the set \(\mathbb {C}_m[x_1, x_2, \ldots , x_{n+1}]\) of all the polynomials of \(\mathbb {C}[x_1,\ldots , x_{n+1}]\) of the degree less than or equal to m and the equivalence relation \(\sim \) on \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\), the equivalence class of an element g in \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\) is the set \(\{f \,{\in }\, \mathbb {C}_{m}[x_1, \ldots ,x_{n+1}] \,{:}\, f \,{\sim }\, g \}\).

In both cases mentioned in the previous paragraph \(\{f = 0\} \cap \Omega = \{g = 0\} \cap \Omega \). The result of the partition of \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\) by the equivalence relation \(\sim \) into equivalence classes yields the quotient space \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]/{\sim }\); we denote its dimension by d(m), called the dimension of \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]\) on \(\Omega \). In [20] it is proved that the dimension of \(\mathbb {C}_{m}[x_1, \ldots ,x_{n+1}]/{\sim }\) is

$$\begin{aligned} d(m)=\left( {\begin{array}{c}n+1+m\\ n+1\end{array}}\right) -\left( {\begin{array}{c}n+1+m-d\\ n+1\end{array}}\right) . \end{aligned}$$
(1)

Let \(U \in \mathbb {R}^{n+1}\) be an open set. A real function \(H(x_1,\ldots ,x_{n+1},t):\mathbb {R}^{n+1} \hspace{0.55542pt}{\times }\hspace{1.111pt}\mathbb {R}\rightarrow \mathbb {R}\) is an invariant of the polynomial vector field X on \(\Omega \cap U\) if \(H(x_1(t),\ldots ,x_{n+1}(t),t)=\textrm{constant}\) for all the values of t for which the orbit \((x_1(t),\ldots ,x_{n+1}(t))\) of X is contained in \(\Omega \cap U\).

If an invariant H is independent on t, then H is a first integral. If a first integral H is a rational function in its variables, then it is called a rational first integral of the vector field X on \(\Omega \cap U\).

Now we present the extension of the Darboux theory of integrability to polynomial vector fields on \(\mathbb {T}^n\). The next theorem characterizes the dimension of the linear space \(\mathbb {C}_m[x_1,\ldots ,x_{n+1}]\) on \(\mathbb {T}^n\).

Theorem 1.1

The dimension d(m) of \(\hspace{0.55542pt}\mathbb {C}_m[x_1,\ldots ,x_{n+1}]\) on \(\mathbb {T}^n\) is

$$\begin{aligned} d(m)=\left( {\begin{array}{c}n+1+m\\ n+1\end{array}}\right) -\left( {\begin{array}{c}n+1+m-2^n\\ n+1\end{array}}\right) . \end{aligned}$$

Theorem 1.1 is proved in Sect. 2. This result follows from a general statement about the dimension of the linear space \(\mathbb {C}_m[x_1,\ldots ,x_{n+1}]\) on \(\Omega \subset \mathbb {R}^{n+1}\) regular algebraic hypersurface proved in [20] and the explicit polynomial expression of \(\mathbb {T}^n\).

Note that for an n-dimensional torus \(\mathbb {T}^n\) we must have \(m \geqslant 2^n\). The following theorem is merging of two known results [20, Theorem 5] and [17, Theorem 2].

Theorem 1.2

Assume that X is a polynomial vector field on \(\mathbb {T}^n\) of degree \(m=(m_1,\ldots ,m_{n+1})\) having p invariant algebraic hypersurfaces \(\{f_i=0\} \cap \mathbb {T}^n\) with cofactors \(K_i\) for \(i=1,\ldots ,p\) and q exponential factors \(F_1,\ldots , F_q\) with \(F_j=\exp \hspace{0.55542pt}(g_j/h_j)\) with cofactors \(L_j\) f or \(j=1,\ldots , q\). Then the following statements hold:

  1. (a)

    There exist \(\lambda _i,\mu _j \in \mathbb {C}\) not all zero such that \(\sum _{i=1}^p \lambda _i K_i + \sum _{j=1}^q \mu _j L_j=0\) on \(\mathbb {T}^n\) if and only if the real (multi-valued) function of Darboux type \(f_1^{\lambda _1} \cdots f_p^{\lambda _p}F_1^{\mu _1} \cdots F_q^{\mu _q}\) substituting \(f_i^{\lambda _i}\) by \(|f_i|^{\lambda _i}\) if \(\lambda _i \in \mathbb {R}\) is a first integral of the vector field X on \(\mathbb {T}^n\).

  2. (b)

    If \(p+q \geqslant d(m)+1\) then there exist \(\lambda _i,\mu _j \in \mathbb {C}\) not all zero such that \(\sum _{i=1}^p \lambda _i K_i + \sum _{j=1}^q \mu _j L_j=0\) on \(\mathbb {T}^n\).

  3. (c)

    There exist \(\lambda _i,\mu _j \in \mathbb {C}\) not all zero such that \(\sum _{i=1}^p \lambda _i K_i + \sum _{j=1}^q \mu _j L_j=-\sigma \) on \(\mathbb {T}^n\) for some \(\sigma \in \mathbb {R}\hspace{1.111pt}{\setminus }\hspace{1.111pt}\{0\}\) if and only if the real (multi-valued) function of Darboux type \(f_1^{\lambda _1} \cdots f_p^{\lambda _p} F_1^{\mu _1} \cdots F_q^{\mu _q} e^{\sigma t}\) substituting \(f_i^{\lambda _i}\) by \(|f_i|^{\lambda _i}\) if \(\lambda _i \in \mathbb {R}\) is an invariant of the vector field X on \(\mathbb {T}^n\).

  4. (d)

    The vector field X on \(\mathbb {T}^n\) has a rational first integral if and only if \(p+q \geqslant d(m)+n\). Moreover, all the trajectories are contained in invariant algebraic hypersurfaces.

The proof of statements (a), (b) and (c) of Theorem 1.2 was done in [20], and the proof of statement (d) was given in [17].

In statement (a) of Theorem 1.2 we claim that the function of Darboux type is real. This is due to the following fact. Since the vector field X is real, it is well known that if a complex invariant algebraic hypersurface or exponential factor appears, then its conjugate has to appear simultaneously. If among the invariant algebraic hypersurfaces of X a complex conjugate pair \(f = 0\) and \({\overline{f}} = 0\) occurs, then the first integral of Darboux type has a real factor of the form \(f^\lambda {\overline{f}}{}^{\overline{\lambda }}\), which is the multi-valued real function

$$\begin{aligned} \bigl [(\text {Re} \, f )^2 + (\text {Im} \, f )^2\bigr ]^{\hspace{0.55542pt}\text {Re} \, \lambda } \exp \hspace{1.111pt}\biggl (2 \hspace{1.111pt}\text {Re} \hspace{0.55542pt}\biggl (\mu \,\frac{h}{g}\biggr )\biggr ). \end{aligned}$$

The parallels of the n-dimensional torus \(\mathbb {T}^n\) are the intersections of \(\mathbb {T}^n\) with hyperplanes \(x_1=\text {constant}\). A parallel is an \((n-1)\)-dimensional torus \(\mathbb {T}^{n-1}\). An interesting question is to know how many invariant parallels a polynomial vector field in \(\mathbb {T}^n\) can have in function of its degree m. The answer is given in the next theorem.

Theorem 1.3

For \(n \geqslant 2\) assume that X is a polynomial vector field on \(\mathbb {T}^n\) of degree \(m=(m_1,\ldots ,m_{n+1})\) having finitely many invariant parallels. Then the number of invariant parallels of X is at most \(\min \hspace{0.55542pt}\{m_{1}, \deg X-2\}\).

Theorem 1.3 is proved in Sect. 3. In particular if \(m_1\geqslant m_2 \geqslant \cdots \geqslant m_{n+1}\) we have that \(\deg X =m_1\) and so the maximum number of invariant parallels is \(m_1-2\).

In the following theorem we provide the most general form of all the polynomial vector fields of degree four having \(\mathbb {T}^2\) as an invariant algebraic surface.

Theorem 1.4

Any polynomial vector field of degree 4 on \(\mathbb {T}^2\) is written in the form \(X=(P_1,P_2,P_3)\) with \(P_1,P_2,P_3\) given in (10), (11) and (12), respectively.

The proof of Theorem 1.4 is given in Sect. 4.

While for the 2-dimensional torus the upper bound on the maximum number of invariant parallels is 2, this upper bound is not reached, we prove that the reached upper bound is 1. This is the result of the following theorem.

Theorem 1.5

There are no polynomial vector fields of degree 4 on \(\mathbb {T}^2\) having the maximum number of 2 of invariant parallels. A polynomial vector field of degree 4 on \(\mathbb {T}^2\) having one invariant parallel is \(X=(P_1,P_2,P_3)\) with

$$\begin{aligned} P_1&= 4 (b_2 c_0 - a_2 d_0) (x_1-\kappa )\hspace{1.111pt}x_3 (r_1^2 - r_2^2 - x_1^2 - x_2^2 - x_3^2),\\ P_2&= 4 x_3 \bigl (b_1 b_2 c_0 \kappa - a_1 b_2 d_0 \kappa \\&\qquad \qquad \quad + ( a_2 b_1 d_0 - b_1 b_2 c_0 + a_2 b_1 d_1 \kappa - a_1 b_2 d_1 \kappa )\hspace{1.111pt}x_1\\&\qquad \qquad \quad + (a_2 b_1 d_2 \kappa - a_1 b_2 d_2)\hspace{1.111pt}\kappa x_2\\&\qquad \qquad \quad + (a_2 b_1 d_3 \kappa - a_1 b_2 d_3 \kappa )\hspace{1.111pt}x_3\bigr ) (x_1^2 + x_2^2 + x_3^2-r_1^2 + r_2^2), \end{aligned}$$

and

$$\begin{aligned} P_3&= b_2 (a_2 b_1 - a_1 b_2)\hspace{1.111pt}\kappa (r_1^2 - r_2^2)^2 - 4 b_2 (b_2 c_0 - a_2 d_0) \hspace{1.111pt}\kappa (r_1^2 + r_2^2)\hspace{1.111pt}x_1 \\ {}&\quad \quad \,\,\,\, + 2 b_2 (2 b_2 c_0 - 2 a_2 d_0 - a_2 b_1 \kappa + a_1 b_2 \kappa ) (r_1^2 + r_2^2)\hspace{1.111pt}x_1^2\\&\quad \quad \,\, \,\,+ 4 b_2 (b_2 c_0 - a_2 d_0)\hspace{1.111pt}\kappa x_1^3 + b_2 (4 a_2 d_0 -4 b_2 c_0 + a_2 b_1 \kappa - a_1 b_2 \kappa )\hspace{1.111pt}x_1^4 \\&\quad \quad \,\,\,\,+ 4 b_2 (b_1 c_0 - a_1 d_0)\hspace{1.111pt}\kappa (r_1^2 + r_2^2)\hspace{1.111pt}x_2\\ {}&\quad \quad \,\,\,\,- 4 \bigl (a_1 b_2 d_1 \kappa + b_1 (b_2 c_0 - a_2 (d_0 + d_1 \kappa ))\bigr ) (r_1^2 + r_2^2)\hspace{1.111pt}x_1 x_2 \\&\quad \quad \,\, \,\,+ 4 b_2 (a_1 d_0-b_1 c_0 )\hspace{1.111pt}\kappa x_1^2 x_2\\ {}&\quad \quad \,\,\,\, + 4 \bigl (a_1 b_2 d_1 \kappa + b_1 (b_2 c_0 - a_2 (d_0 + d_1 \kappa ))\bigr )\hspace{1.111pt}x_1^3 x_2 \\ {}&\quad \quad \,\,\,\,- 2 (a_2 b_1 - a_1 b_2) (b_2 - 2 d_2)\hspace{1.111pt}\kappa (r_1^2 + r_2^2)\hspace{1.111pt}x_2^2 \\ {}&\quad \quad \,\,\,\,+ 4 b_2 (b_2 c_0 - a_2 d_0)\hspace{1.111pt}\kappa x_1 x_2^2\\ {}&\quad \quad \,\,\,\, - 2 \bigl (2 a_2 b_1 d_2 \kappa + b_2^2 (2 c_0 + a_1 \kappa ) - b_2 (2 a_2 d_0 + a_2 b_1 \kappa + 2 a_1 d_2 \kappa )\bigr )\hspace{1.111pt}x_1^2 x_2^2\\ {}&\quad \quad \,\, \,\,+ 4 b_2 (a_1 d_0-b_1 c_0 )\hspace{1.111pt}\kappa x_2^3 + 4 \bigl (a_1 b_2 d_1 \kappa + b_1 (b_2 c_0 - a_2 (d_0 + d_1 \kappa ))\bigr )\hspace{1.111pt}x_1 x_2^3 \\&\quad \quad \,\,\,\,+ (a_2 b_1 - a_1 b_2) (b_2 - 4 d_2) \hspace{1.111pt}\kappa x_2^4 + 4 (a_2 b_1 - a_1 b_2)\hspace{1.111pt}d_3 \kappa (r_1^2 + r_2^2)\hspace{1.111pt}x_2 x_3 \\ {}&\quad \quad \,\,\,\,+ 4 ( a_1 b_2-a_2 b_1 )\hspace{1.111pt}d_3 \kappa x_1^2 x_2 x_3 + 4 (a_1 b_2-a_2 b_1 )\hspace{1.111pt}d_3 \kappa x_2^3 x_3\\ {}&\quad \quad \,\, \,\,+ 2 b_2 (a_1 b_2-a_2 b_1 )\hspace{1.111pt}\kappa (r_1^2 - r_2^2)\hspace{1.111pt}x_3^2 + 4 b_2 (b_2 c_0 - a_2 d_0)\hspace{1.111pt}\kappa x_1 x_3^2 \\&\quad \quad \,\,\,\,+ 2 b_2 (2 a_2 d_0 -2 b_2 c_0 + a_2 b_1 \kappa - a_1 b_2 \kappa )\hspace{1.111pt}x_1^2 x_3^2 + 4 b_2 (a_1 d_0-b_1 c_0 )\hspace{1.111pt}\kappa x_2 x_3^2\\ {}&\quad \quad \,\,\,\,+ 4 \bigl (a_1 b_2 d_1 \kappa + b_1 (b_2 c_0 - a_2 (d_0 + d_1 \kappa ))\bigr )\hspace{1.111pt}x_1 x_2 x_3^2\\&\quad \quad \,\,\,\,+ 2 (a_2 b_1 - a_1 b_2) (b_2 - 2 d_2)\hspace{1.111pt}\kappa x_2^2 x_3^2\\ {}&\quad \quad \,\,\,\,+ 4 (a_1 b_2-a_2 b_1 )\hspace{1.111pt}d_3 \kappa x_2 x_3^3 + b_2 (a_2 b_1 - a_1 b_2)\hspace{1.111pt}\kappa x_3^4. \end{aligned}$$

for any \(\kappa ,a_1,a_2,b_1,b_2,c_0,d_0,d_1,d_2,d_3 \in \mathbb {R}\) with \(\kappa b_2 \ne 0\).

The proof of Theorem 1.5 is given in Sect. 5.

2 Proof of Theorem 1.1

We first introduce some preliminary results that will be used to prove Theorem 1.1.

Let \(\mathbb {T}^n =(\mathbb {S}^1)^n \) be an n-dimensional torus in \(\mathbb {R}^{n+1}\). We first define an embedding from \(\mathbb {T}^n\) to \(\mathbb {R}^{n+1}\). For this we consider the following map \(\Phi ^{(n)} :(\mathbb {S}^1)^{n} \rightarrow \mathbb {R}^{n+1}\) given by \(\Phi ^{(n)}_{r_1,\ldots ,r_{n}}(\alpha _1,\ldots , \alpha _n) \mapsto (x_1,\ldots ,x_{n+1})\) defined by

$$\begin{aligned} \begin{aligned} x_1&= r_1 \sin \alpha _1, \\ x_j&=\biggl (r_j + \frac{x_{j-1}}{\sin \alpha _{j-1}} \cos \alpha _{j-1}\biggr )\sin \alpha _j \quad \text {for}\;\; j=2,\ldots , n, \\ x_{n+1}&= \frac{x_n}{\sin \alpha _n}\cos \alpha _n \end{aligned} \end{aligned}$$

with

$$\begin{aligned} r_1> 1 \quad \text {and} \quad r_j > \sum _{i=1}^{j-1}\hspace{1.111pt}r_i \;\; \text {for }\; j=2,\ldots ,n. \end{aligned}$$

Lemma 2.1

The map \(\Phi =\Phi ^{(n)}_{r_1,\ldots ,r_{n}}(\alpha _1,\ldots , \alpha _n)\) is injective.

Proof

Let \(\Phi ^{(n-1)}_{r_1,\ldots ,r_{n-1}} (\alpha _1,\ldots , \alpha _{n-1})=({\bar{x}}_1,\ldots ,{\bar{x}}_n)\) denote the embedding of the torus \(\mathbb {T}^{n-1}\) into \(\mathbb {R}^n\). Note that we can write \(\Phi ^{(n)}_{r_1,\ldots ,r_n}(\alpha _1,\ldots ,\alpha _n)=(x_1,\ldots ,x_{n+1})\) the embedding of \(\mathbb {T}^n\) into \(\mathbb {R}^{n+1}\) as follows:

$$\begin{aligned} \begin{aligned} x_j&={\bar{x}}_j, \quad j=1,\ldots ,n-1, \\ x_{n}&= \biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \cos \alpha _{n-1}\biggr ) \sin \alpha _n, \\ x_{n+1}&= \biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \cos \alpha _{n-1}\biggr )\cos \alpha _n. \end{aligned} \end{aligned}$$

Now we shall prove the injectivity of \(\Phi ^{(n)}_{r_1,\ldots ,r_n}(\alpha _1,\ldots ,\alpha _n)\). We proceed by induction.

For \(n=2\) assume that \(\Phi ^{(2)}_{r_1,r_2}(\alpha _1,\alpha _2) = \Phi ^{(2)}_{r_1,r_2}(\alpha _1',\alpha _2')\) with \(\alpha _1,\alpha _2, \alpha _1', \alpha _2' \in [0,2\pi )\). Taking into account that

$$\begin{aligned} \Phi ^{(2)}_{r_1,r_2}(\alpha _1,\alpha _2) = \bigl (r_1 \sin \alpha _1,( r_2 + r_1 \cos \alpha _1) \sin \alpha _2, (r_2 + r_1 \cos \alpha _1) \cos \alpha _2\bigr ), \end{aligned}$$

imposing \(\Phi ^{(2)}_{r_1,r_2}(\alpha _1,\alpha _2) = \Phi ^{(2)}_{r_1,r_2}(\alpha _1',\alpha _2')\) we get

$$\begin{aligned} \begin{aligned} r_1 \sin \alpha _1&= r_1 \sin \alpha '_1, \\ ( r_2 + r_1 \cos \alpha _1) \sin \alpha _2&=( r_2 + r_1 \cos \alpha '_1) \sin \alpha '_2, \\ ( r_2 + r_1 \cos \alpha _1) \cos \alpha _2&=( r_2 + r_1 \cos \alpha '_1) \cos \alpha '_2. \end{aligned} \end{aligned}$$
(2)

From the first equation in (2) we get \(\sin \alpha _1=\sin \alpha _1'\). From the second and third equations in (2) we get

$$\begin{aligned} (r_2 + r_1 \cos \alpha _1 )^2 = (r_2 + r_1 \cos \alpha _1' )^2. \end{aligned}$$

Since \(r_2 > r_1 \) we have

$$\begin{aligned} \cos \alpha _1'=\cos \alpha _1, \end{aligned}$$

and so \(\alpha _1'=\alpha _1\), because \(\sin \alpha _1=\sin \alpha _1'\). Therefore from the second and third equations of (2) we get \(\sin \alpha _2 =\sin \alpha _2'\) and \(\cos \alpha _2'=\cos \alpha _2\), respectively. Consequently, \(\alpha _2=\alpha _2'\) which proves the claim for \(n=2\).

Now assume it is true until \(n-1\) and we will prove it for n. Assume that

$$\begin{aligned} \Phi ^{(n)}_{r_1,\ldots ,r_n}(\alpha _1,\ldots , \alpha _n) = \Phi ^{(n)}_{r_1,\ldots ,r_n}(\alpha _1',\ldots , \alpha _n') \end{aligned}$$

with \(\alpha _1,\ldots , \alpha _n, \alpha _1', \ldots ,\alpha _n' \in [0,2\pi )\). Then by the induction process and the construction of \(\Phi ^{(n)}_{r_1,\ldots ,r_n}(\alpha _1,\ldots , \alpha _n)\) in terms of \(\Phi ^{(n-1)}_{r_1,\ldots ,r_{n-1}}(\alpha _1,\ldots , \alpha _{n-1})\), we get \(\alpha _1'=\alpha _1, \ldots , \alpha _{n-2}' =\alpha _{n-2}\) and

$$\begin{aligned} \begin{aligned} \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \sin \alpha _{n-1}&=\frac{{\bar{x}}_n}{\sin \alpha '_{n-1}} \sin \alpha '_{n-1}, \\ \biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \cos \alpha _{n-1} \biggr )\sin \alpha _n&=\biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha '_{n-1}} \cos \alpha '_{n-1}\biggr )\sin \alpha '_n, \\ \biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \cos \alpha _{n-1}\biggr )\cos \alpha _n&=\biggl (r_n + \frac{\bar{x}_n}{\sin \alpha '_{n-1}} \cos \alpha '_{n-1} \biggr )\cos \alpha '_n. \end{aligned} \end{aligned}$$
(3)

Note that since \(\alpha _j=\alpha _j'\) for \(j=1,\ldots , n-2\) and \({\bar{x}}_n/{\sin \alpha _{n-1}} \) only depends on \(\alpha _1,\ldots , \alpha _{n-2}\) we have that

$$\begin{aligned} \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} =\frac{{\bar{x}}_n}{\sin \alpha '_{n-1}}\hspace{0.55542pt}. \end{aligned}$$
(4)

From the second and third relations in (3) we get

$$\begin{aligned} \biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \cos \alpha _{n-1}\biggr )^{\!2} = \,\biggl (r_n + \frac{{\bar{x}}_n}{\sin \alpha '_{n-1}} \cos \alpha '_{n-1} \biggr )^{\!2}, \end{aligned}$$

and since \(r_n > \sum _{j=1}^{n-1} r_j\), we readily obtain that

$$\begin{aligned} \frac{{\bar{x}}_n}{\sin \alpha _{n-1}} \cos \alpha _{n-1}=\frac{{\bar{x}}_n}{\sin \alpha '_{n-1}} \cos \alpha '_{n-1}, \end{aligned}$$

which together with the first relation in (3) and (4) gives

$$\begin{aligned} \cos \alpha '_{n-1} = \cos \alpha _{n-1} \quad \text {and} \quad \sin \alpha '_{n-1} = \sin \alpha _{n-1}, \end{aligned}$$

which yields \(\alpha _{n-1} =\alpha '_{n-1}\). Now from the last two identities in (3) we obtain that \(\alpha _n=\alpha _n'\) as we wanted to prove. \(\square \)

Lemma 2.2

For each \(n \geqslant 2\) the map \(\Phi =\Phi ^{(n)}_{r_1,\ldots ,r_n}\) is a homeomorphism from \(\mathbb {T}^n\) to \(\Phi (\mathbb {T}^n) \subset \mathbb {R}^{n+1}\).

Proof

Since \(\mathbb {T}^n\) is compact and \(\Phi \) is continuous, it follows from the following result: A continuous function \(f :U \rightarrow V\) from a compact space U into a Hausdorff space V is always a homeomorphism, see for instance [13, p. 23]. So \(\Phi \) is a homeomorphism from \(\mathbb {T}^n\) to \(\Phi (\mathbb {T}^n) \subset \mathbb {R}^{n+1}\). \(\square \)

It follows from Lemmas 2.1 and 2.2 that \(\Phi ^{(n)}_{r_1,\ldots ,r_n}\) defines a parameterization of the n-dimensional torus \(\mathbb {T}^n\).

Now we continue with the proof of the theorem.

Using the parameterization \(\Phi ^{(n)}(\alpha _1,\ldots ,\alpha _n)=(x_1,\ldots ,x_{n+1})\), we obtain that the n-dimensional torus in Cartesian coordinates can be expressed as follows:

$$\begin{aligned} y_{n+1}^2 +\varphi _n^2 =R_{n+1}^2, \quad y_j=x_{n+2-j}, \; R_j = r_{n+2-j}, \;\; j=1,\ldots , n+1, \end{aligned}$$
(5)

and

$$\begin{aligned} \varphi _j = \sqrt{y_j^2 + \varphi _{j-1}^2 }-R_j, \; j=2,\ldots , n+1, \quad \text {and} \quad \varphi _1= y_1. \end{aligned}$$
(6)

We have the following lemma.

Lemma 2.3

For each \(n \geqslant 2\) there exists a polynomial \(Q_{2^n} \in \mathbb {C}_{2^n} [x_1,\ldots ,x_{n+1}]\) of degree \(2^n\) such that (5) can be written as

$$\begin{aligned} Q_{2^n}(x_1,\ldots ,x_{n+1})=0. \end{aligned}$$

Proof

We proceed by induction. If \(n=2\) then

$$\begin{aligned} y_3^2 + \Bigl (\!\sqrt{y_2^2 + y_1^2 }-R_2\Bigr )^2 =R_3^2, \end{aligned}$$

that can be written as

$$\begin{aligned} 2 R_2 \sqrt{y_2^2 +y_1^2} = R_3^2 -y_3^2 - y_2^2 -y_1^2 -R_2^2. \end{aligned}$$

which yields

$$\begin{aligned} 4 R_2^2 (y_1^2 +y_2^2)=\bigl (R_3^2 -y_3^2 - y_2^2 -y_1^2 -R_2^2 \bigr )^2 \end{aligned}$$

or in other words

$$\begin{aligned} Q_4 (y_1,y_2,y_3)=Q_4(x_1,x_2,x_3)=0, \end{aligned}$$

as we wanted to prove.

Assume it is true until \(n-1\) and we want to prove it for n. By the induction hypothesis we have that

$$\begin{aligned} y_n^2 +\varphi _{n-1}^2 -R_{n}^2 =Q_{2^{n-1}}(y_1,\ldots ,y_n). \end{aligned}$$

It follows from (5) and (6) that

$$\begin{aligned} y_{n+1}^2 +y_n ^2 + \varphi _{n-1}^2 +R_n^2 -2 R_n \sqrt{y_n^2 +\varphi ^2_{n-1}} =R_{n+1}^2, \end{aligned}$$

and so

$$\begin{aligned} y_{n+1}^2 + Q_{2^{n-1}}(y_1,\ldots ,y_n) + 2 R_{n}^2 -R_{n+1}^2 = 2 R_n \sqrt{y_n^2 +\varphi ^2_{n-1}}. \end{aligned}$$

Taking squares we get

$$\begin{aligned} \begin{aligned} \bigl (y_{n+1}^2 + Q_{2^{n-1}}(y_1,\ldots ,y_n) + 2 R_{n}^2 -R_{n+1}^2 \bigr )^2&\! = 4 R_n^2 (y_n^2 + \varphi ^2_{n-1})\\&\!= 4 R_n^2 \bigl (Q_{2^{n-1}}(y_1,\ldots ,y_n) +R_n^2\bigr ), \end{aligned} \end{aligned}$$

or in other words

$$\begin{aligned} Q_{2^n}(y_1,\ldots ,y_{n+1})=0 \quad \text {that is} \;\; Q_{2^n}(x_1,\ldots ,x_{n+1})=0, \end{aligned}$$

because \(Q_{2^{n-1}}(y_1,\ldots ,y_n)^2\) is a polynomial of degree \(2^n\). \(\square \)

It follows from Lemma 2.3 that \(\mathbb {T}^n\) is regular and that we can rewrite it as

$$\begin{aligned} Q_{2^n} (x_1,\ldots , x_{n+1}) =0\quad \text {for some polynomial} Q_{2^n} \text {of degree} 2^n. \end{aligned}$$

So we have that \(d=2^n\). Hence from (1) we have that \(\mathbb {C}_m[x_1,\ldots ,x_{n+1}]\) on the n-dimensional torus \(\mathbb {T}^n\) is a \(\mathbb {C}\)-linear space of dimension

$$\begin{aligned} d(m) =\left( {\begin{array}{c}m+n+1\\ n+1\end{array}}\right) - \left( {\begin{array}{c}m+n+1-2^n\\ n+1\end{array}}\right) . \end{aligned}$$

This completes the proof of the theorem.

3 Proof of Theorem 1.3

One of the best tools for searching invariant algebraic hypersurfaces is the extactic polynomial of X associated to W, where W a finitely generated vector subspace of the vector space \(\mathbb {C}\hspace{0.55542pt}[x_1,\ldots ,x_d]\) with basis \(\{v_1,\ldots ,v_l\}\), being l its dimension (see for instance [8, 16, 27]). The extactic polynomial of X associated to W is

$$\begin{aligned} {\mathscr {E}}_W(X) = {\mathscr {E}} _{\{v_1,\ldots ,v_l\}} (X)=\det \begin{pmatrix} v_1 &{} v_2 &{} \cdots &{} v_l \\ X(v_1) &{} X(v_2) &{} \cdots &{} X(v_l) \\ \vdots &{} \vdots &{} \vdots \\ X^{l-1}(v_1) &{} X^{l-1}(v_2) &{} \cdots &{} X^{l-1}(v_l) \end{pmatrix}=0 \end{aligned}$$

Note that \(X^j(v_k)=X^{j-1} (X(v_k))\). In view of the properties of the determinants, the extactic polynomial does not depend on the chosen basis of W. The next proposition is proved in [6].

Proposition 3.1

Let X be a polynomial vector field in \(\mathbb {C}^d\) and let W be a finitely generated vector subspace of \(\hspace{1.111pt}\mathbb {C}\hspace{0.55542pt}[x_1, \ldots , x_d]\) with \(\dim \hspace{0.55542pt}(W) > 1\). Then every algebraic invariant hypersurface \(f=0\) for the vector field X, with \(f \in W\), is a factor of the polynomial \({\mathscr {E}}_W(X)\).

From Proposition 3.1 it follows that \(f = 0\) is an invariant hyperplane of the polynomial vector field X if the polynomial f is a factor of the polynomial \({\mathscr {E}}_W(X)\), where W is generated by \(\{1, x_1, \ldots ,x_d\}\).

Proof of Theorem 1.3

By definition an invariant parallel is the intersection of an invariant hyperplane of the form \(x_{1}=\kappa \), where \(\kappa \in \mathbb {R}\), with the n-dimensional torus \(\mathbb {T}^n\). Thus this intersection is a \(\mathbb {T}^{n-1}\) \((n-1)\)-dimensional torus. From Proposition 3.1 we know that if \(x_{1}-\kappa =0\) is an invariant hyperplane of polynomial vector field X, then \(x_{1}-\kappa \) is a factor of the extactic polynomial. So the maximum number of factors of the form \(x_{1}-\kappa \) of the extactic polynomial \({\mathscr {E}}_{\{1,x_{n+1}\}}(X)\) gives an upper bound for the number of invariant planes \(\{x_{1}-\kappa =0\}\) of X, and this allows to obtain an upper bound for the number of its invariant parallels.

From the definition of extactic polynomial we get

$$\begin{aligned} \det \begin{pmatrix} 1 &{} x_{1} \\ X(1) &{} X(x_{1}) \end{pmatrix} = \det \begin{pmatrix} 1 &{} x_{1} \\ 0 &{} P_{1} (x_1,\ldots ,x_{n+1}) \end{pmatrix} = P_1= P_{1} (x_1,\ldots ,x_{n+1}). \end{aligned}$$

Since the degree of \(P_{1}\) is \(m_{1}\) this polynomial can have at most \(m_{1}\) linear factors of the form \(x_{1}-\kappa \) and so the number of invariant parallels of X on \(\mathbb {T}^n\) is at most \(m_{1}\).

However this bound can be improved after imposing that the n-dimensional torus \(\mathbb {T}^n\) is an invariant algebraic hypersurface of the vector field \(X=(P_1,\ldots ,P_{n+1})\). First we recall that in view of Theorem 1.1 and its proof, we can write \(\mathbb {T}^n\) as \(F=0\) being

$$\begin{aligned} F(x_1,\ldots ,x_{n+1}) = {\widetilde{F}}(x_1^2, \ldots , x_{n+1}^2)={\widetilde{F}}(z_1, \ldots , z_{n+1}), \end{aligned}$$

and it has degree \(2^n\). Moreover it follows also from that theorem and its proof that

$$\begin{aligned} F(x_1,0,\ldots ,0,0)=x_{1}^{2} + \biggl (r_{n+1} -\sum _{i=2}^n r_i \biggr )^{\!2}-r_1 \end{aligned}$$

and \(r_{n+1} > \sum _{i=2}^n r_i +r_1\) with \(r_1 > 1\). Note that this implies

$$\begin{aligned} {\widetilde{F}}(x_1^2,0,\ldots ,0,0)={\widetilde{F}}(z_1,0,\ldots ,0,0)=z_1 + \biggl (r_{n+1} -\sum _{i=2}^n r_i \biggr )^{\!2}-r_1. \end{aligned}$$

Then

$$\begin{aligned} 2 x_1 \frac{\partial {\widetilde{F}}}{\partial z_1}\, P_1 + \cdots + 2 x_{n+1} \frac{\partial {\widetilde{F}}}{\partial z_{n+1}}\, P_{n+1} =K {\widetilde{F}} \end{aligned}$$
(7)

for all \((x_1,\ldots ,x_{n+1}) \in \mathbb {R}^{n+1}\) and where \(K=K(x_1,\ldots ,x_{n-1})\) is a polynomial of degree \(m-1\) being \(m=\deg X\).

We write

$$\begin{aligned} P_1 = h(x_1,\ldots ,x_{n+1}) \prod _{i=1}^l\hspace{1.111pt}(x_1 -\kappa _i), \end{aligned}$$

in such a way that \(x_1-\kappa _i\) for all \(\kappa _i \in \mathbb {R}\) is not a factor of the polynomial h, eventually some of the \(\kappa _i\)’s can be the same. Then

$$\begin{aligned} {\mathscr {E}}_{\{1,x_1\}} = h(x_1,\ldots ,x_{n+1}) \prod _{i=1}^l \hspace{1.111pt}(x_1-\kappa _i). \end{aligned}$$

Since (7) holds for all \(x_1,\ldots ,x_{n+1} \in \mathbb {R}\), in particular it must hold for \(x_2=\cdots =x_{n+1}=0\) and so,

$$\begin{aligned} 2 x_1 h(x_1,0,\ldots ,0) \prod _{i=1}^l\hspace{1.111pt}(x_1-\kappa _i) = \biggl (\hspace{1.111pt}\sum _{i=0}^{m-1} k_i x_1^i \biggr )\biggl (x_{1}^{2} + \biggl (r_{n+1} -\sum _{i=2}^n r_i \biggr )^{\!2}\!-r_1\biggr ), \end{aligned}$$

where \(k_i =k_i(x_2,\ldots ,x_{n+1})\) is a polynomial for \(i=0,\ldots ,m-1\). From this equation we have that \(k_0=0\) and consequently

$$\begin{aligned} 2 x_1 h(x_1,0,\ldots ,0) \prod _{i=1}^l \hspace{1.111pt}(x_1-\kappa _i) =x_1 \biggl (\hspace{1.111pt}\sum _{i=0}^{m-2} k_i x_1^i \biggr ) \biggl (x_{1}^{2} + \biggl (r_{n+1} -\sum _{i=2}^n r_i \biggr )^{\!2}\!-r_1\biggr ). \end{aligned}$$

Taking into account that \(r_{n+1} > \sum _{i=2}^n r_i +r_1\) and \(r_1>1\), we see that

$$\begin{aligned} x_{1}^{2} + \biggl (r_{n+1} -\sum _{i=2}^n r_i \biggr )^{\!2}\!-r_1> x_{1}^{2} + r_1^2-r_1 >0, \end{aligned}$$

and consequently it does not factorize in \(\mathbb {R}\hspace{0.55542pt}[x_1]\). This assertion together with the fact that \(h(x_1,\ldots , x_{n+1})\) has no factor of the form \(x_1-\kappa \) we get that \(l \leqslant m-2\). So \(\mathscr {E}_{\{1,x_1\}}(X)\) has at most \(m-2\) factors of the form \(x_1=\kappa \) with \(\kappa \in \mathbb {R}\). Hence X has at most \(m-2\) invariant hyperplanes of the form \(x_1=\kappa \) with \(\kappa \in \mathbb {R}\), and consequently X has at most \(m-2\) invariant parallels.

Therefore we have that the maximum number of invariant parallels that X can have is

$$\begin{aligned} \min \hspace{0.55542pt}\{ m_1, m-2\} =\min \hspace{0.55542pt}\{m_1, \deg X -2\}. \end{aligned}$$

This completes the proof of the theorem. \(\square \)

4 Proof of Theorem 1.4

In view of Theorem 1.1 the n-dimensional torus \(\mathbb {T}^2\) in Cartesian coordinates can be written as the surface

$$\begin{aligned} g_1=\bigl (x_1^2 + x_2^2 + x_3^2 +r_1^2 -r_2^2\bigr )^2 -4 r_2^2 (x_1^2 +x_2^2)=0, \end{aligned}$$
(8)

which is the surface \(Q_4(x_1,x_2,x_3)=0\) of Lemma 2.3.

It follows from [19, Theorem 1.3.1] that any polynomial differential system in \(\mathbb {R}^3\) having \(g_1=0\) as an invariant algebraic surface must be written in the form \(X=(P_1,P_2,P_3)\) where

$$\begin{aligned} \begin{aligned} P_ 1&= \phi \{x_1,g_2,g_3\} + \lambda _1 \{g_1,x_1,g_3\} + \lambda _2 \{g_1,g_2,x_1\}, \\ P_2&= \phi \{x_2,g_2,g_3\} + \lambda _1 \{g_1,x_2,g_3\} + \lambda _2 \{g_1,g_2,x_2\}, \\ P_3&= \phi \{x_3,g_2,g_3\} + \lambda _1 \{g_1,x_3,g_3\} + \lambda _2 \{g_1,g_2,x_3\}, \end{aligned} \end{aligned}$$
(9)

where \(\phi \) is a polynomial in the variables \(x_1,x_2,x_3\) satisfying \(\phi |_{g_1=0}\!=0\) and \(\lambda _i\) for \(i=1,2\) are arbitrary polynomials in the variables \((x_1,x_2,x_3)\). Moreover, \(\{f,g,h\}\) denotes the Nambu bracket of the polynomials \(f=f(x_1,x_2,x_3)\), \(g=g(x_1,x_2,x_3)\), \(h=h(x_1,x_2,x_3)\) which is defined as

$$\begin{aligned} \{f,g,h\}=\det \begin{pmatrix} f_{x_1} &{} f_{x_2} &{} f_{x_3} \\ g_{x_1} &{} g_{x_2} &{} g_{x_3} \\ h_{x_1} &{} h_{x_2} &{} h_{x_3} \end{pmatrix}. \end{aligned}$$

Since we are looking for polynomial vector fields of degree four and \(g_1\) is a polynomial of degree four, without loss of generality we can take \(\phi =\phi (x_1,x_2,x_3)=g_1(x_1,x_2,x_3)\) (because rescaling the time if necessary any constant can be passed to one). Moreover since \(\deg g_1=4\) we have that the degrees of \(g_2,g_3,\lambda _1,\lambda _2\) must be one. So we take them as follows:

$$\begin{aligned} \begin{aligned} g_2 (x_1,x_2,x_3)&=a_0 + a_1 x_1 + a_2 x_2 + a_3 x_3, \\ g_3 (x_1,x_2,x_3)&=b_0 + b_1 x_1 + b_2 x_2 + b_3 x_3, \\ \lambda _1 (x_1,x_2,x_3)&=c_0 + c_1 x_1 + c_2 x_2 + c_3 x_3, \\ \lambda _2 (x_1,x_2,x_3)&=d_0 + d_1 x_1 + d_2 x_2 + d_3 x_3, \\ \end{aligned} \end{aligned}$$

for any \(a_i,b_i,c_i,d_i \in \mathbb {R}\) for \(i=0,\ldots ,3\).

It follows from (9) that \(P_1\) is equal to

$$\begin{aligned}&{} -(a_3 b_2 - a_2 b_3) (r_1^2 - r_2^2)^2 + 4 (b_3 c_0 - a_3 d_0) (r_1^2 + r_2^2)\hspace{1.111pt}x_2\nonumber \\ {}&- 4 (b_2 c_0 - a_2 d_0) (r_1^2 - r_2^2)\hspace{1.111pt}x_3 + 2 (a_3 b_2 - a_2 b_3) (r_1^2 + r_2^2)\hspace{1.111pt}x_1^2\nonumber \\ {}&+ 4 (b_3 c_1 - a_3 d_1) (r_1^2 + r_2^2)\hspace{1.111pt}x_1 x_2 - 4 (b_2 c_1 - a_2 d_1) (r_1^2 - r_2^2)\hspace{1.111pt}x_1 x_3 \nonumber \\&+ 2 (a_3 b_2 - a_2 b_3 + 2 b_3 c_2 - 2 a_3 d_2) (r_1^2 + r_2^2)\hspace{1.111pt}x_2^2\nonumber \\ {}&+ 4 \bigl (a_2 d_2 r_1^2 - a_3 d_3 r_1^2 - a_2 d_2 r_2^2 - a_3 d_3 r_2^2 + b_2 c_2 ( r_2^2\!-r_1^2 ) + b_3 c_3 (r_1^2\!+ r_2^2)\bigr )\hspace{1.111pt}x_2 x_3\nonumber \\ {}&+ 2 (a_3 b_2 - a_2 b_3 - 2 b_2 c_3 + 2 a_2 d_3) (r_1^2 - r_2^2)\hspace{1.111pt}x_3^2 \nonumber \\&+ 4 (a_3d_0-b_3 c_0 )\hspace{1.111pt}x_1^2 x_2 + 4 (b_2 c_0 - a_2 d_0)\hspace{1.111pt}x_1^2 x_3 + 4 (a_3d_0-b_3 c_0)\hspace{1.111pt}x_2^3 \nonumber \\ {}&+ 4 (b_2 c_0 - a_2 d_0)\hspace{1.111pt}x_2^2 x_3 + 4 (a_3 d_0-b_3 c_0)\hspace{1.111pt}x_2 x_3^2 + 4 (b_2 c_0 - a_2 d_0)\hspace{1.111pt}x_3^3\nonumber \\ {}&+ (a_2 b_3-a_3 b_2)\hspace{1.111pt}x_1^4 + 4 (a_3 d_1-b_3 c_1 )\hspace{1.111pt}x_1^3 x_2 + 4 (b_2 c_1 - a_2 d_1)\hspace{1.111pt}x_1^3 x_3\nonumber \\ {}&- 2 (a_3 b_2 - a_2 b_3 + 2 b_3 c_2 - 2 a_3 d_2)\hspace{1.111pt}x_1^2 x_2^2\nonumber \\ {}&+ 4 (b_2 c_2 - b_3 c_3 - a_2 d_2 + a_3 d_3)\hspace{1.111pt}x_1^2 x_2 x_3\nonumber \\ {}&+ 2 (-a_3 b_2 + 2 b_2 c_3 + a_2 (b_3 - 2 d_3))\hspace{1.111pt}x_1^2 x_3^2\nonumber \\ {}&+ 4 (a_3 d_1-b_3 c_1)\hspace{1.111pt}x_1 x_2^3 + 4 (b_2 c_1 - a_2 d_1)\hspace{1.111pt}x_1 x_2^2 x_3 + 4 (a_3 d_1-b_3 c_1)\hspace{1.111pt}x_1 x_2 x_3^2\nonumber \\ {}&+ 4 (b_2 c_1 - a_2 d_1)\hspace{1.111pt}x_1 x_3^3 - (a_3 b_2 - a_2 b_3 + 4 b_3 c_2 - 4 a_3 d_2)\hspace{1.111pt}x_2^4\nonumber \\ {}&+ 4 (b_2 c_2 - b_3 c_3 - a_2 d_2 + a_3 d_3)\hspace{1.111pt}x_2^3 x_3 \nonumber \\ {}&+ 2 (-a_3 b_2 + a_2 b_3 - 2 b_3 c_2 + 2 b_2 c_3 + 2 a_3 d_2 - 2 a_2 d_3)\hspace{1.111pt}x_2^2 x_3^2\nonumber \\ {}&+ 4 (b_2 c_2 - b_3 c_3 - a_2 d_2 + a_3 d_3)\hspace{1.111pt}x_2 x_3^3\nonumber \\ {}&- (a_3 b_2 - 4 b_2 c_3 - a_2 (b_3 - 4 d_3))\hspace{1.111pt}x_3^4, \end{aligned}$$
(10)

\(P_2\) is equal to

$$\begin{aligned}&(a_3 b_1 - a_1 b_3) (r_1^2 - r_2^2)^2 - 4 (b_3 c_0 - a_3 d_0) (r_1^2 + r_2^2)\hspace{1.111pt}x_1 \nonumber \\ {}&\quad + 4 (b_1 c_0 - a_1 d_0) (r_1^2 - r_2^2)\hspace{1.111pt}x_3 - 2 (a_3 b_1 - a_1 b_3 + 2 b_3 c_1 - 2 a_3 d_1) (r_1^2 + r_2^2)\hspace{1.111pt}x_1^2\nonumber \\ {}&\quad - 4 (b_3 c_2 - a_3 d_2) (r_1^2 + r_2^2)\hspace{1.111pt}x_1 x_2\nonumber \\&\quad - 4 \bigl (a_1 d_1 r_1^2 - a_3 d_3 r_1^2 - a_1 d_1 r_2^2 - a_3 d_3 r_2^2 + b_1 c_1 (r_2^2-r_1^2 ) + b_3 c_3 (r_1^2\! + r_2^2)\bigr )\hspace{1.111pt}x_1 x_3\nonumber \\&\quad - 2 (a_3 b_1 - a_1 b_3) (r_1^2 + r_2^2)\hspace{1.111pt}x_2^2 + 4 (b_1 c_2 - a_1 d_2) (r_1^2 - r_2^2)\hspace{1.111pt}x_2 x_3 \nonumber \\ {}&\quad - 2 (a_3 b_1 - a_1 b_3 - 2 b_1 c_3 + 2 a_1 d_3) (r_1^2 - r_2^2)\hspace{1.111pt}x_3^2\nonumber \\ {}&\quad + 4 (b_3 c_0 - a_3 d_0)\hspace{1.111pt}x_1^3 + 4 (a_1d_0 -b_1 c_0 )\hspace{1.111pt}x_1^2 x_3 + 4 (b_3 c_0 - a_3 d_0)\hspace{1.111pt}x_1 x_2^2\nonumber \\&\quad + 4 (b_3 c_0 - a_3 d_0)\hspace{1.111pt}x_1 x_3^2 + 4 (a_1d_0-b_1 c_0 )\hspace{1.111pt}x_2^2 x_3 + 4 (a_1d_0-b_1 c_0 )\hspace{1.111pt}x_3^3\nonumber \\ {}&\quad + (a_3 b_1 - a_1 b_3 + 4 b_3 c_1 - 4 a_3 d_1)\hspace{1.111pt}x_1^4 \nonumber \\ {}&\quad + 4 (b_3 c_2 - a_3 d_2)\hspace{1.111pt}x_1^3 x_2 -4 (b_1 c_1 - b_3 c_3 - a_1 d_1 + a_3 d_3)\hspace{1.111pt}x_1^3 x_3\nonumber \\ {}&\quad + 2 (a_3 b_1 - a_1 b_3 + 2 b_3 c_1 - 2 a_3 d_1)\hspace{1.111pt}x_1^2 x_2^2 + 4 (a_1 d_2-b_1 c_2)\hspace{1.111pt}x_1^2 x_2 x_3\nonumber \\ {}&\quad + 2 \bigl (2 b_3 c_1-a_1 b_3 - 2 b_1 c_3 + a_3 (b_1 - 2 d_1)+ 2 a_1 d_3\bigr )\hspace{1.111pt}x_1^2 x_3^2\nonumber \\ {}&\quad + 4 (b_3 c_2 - a_3 d_2)\hspace{1.111pt}x_1 x_2^3 + 4 ( b_3 c_3-b_1 c_1 + a_1 d_1 - a_3 d_3)\hspace{1.111pt}x_1 x_2^2 x_3\nonumber \\ {}&\quad + 4 (b_3 c_2 - a_3 d_2)\hspace{1.111pt}x_1 x_2 x_3^2 + 4 ( b_3 c_3-b_1 c_1 + a_1 d_1 - a_3 d_3)\hspace{1.111pt}x_1 x_3^3 \nonumber \\ {}&\quad + (a_3 b_1 - a_1 b_3)\hspace{1.111pt}x_2^4 + 4 ( a_1 d_2 -b_1 c_2)\hspace{1.111pt}x_2^3 x_3 \nonumber \\&\quad + 2 (a_3 b_1 - a_1 b_3 - 2 b_1 c_3 + 2 a_1 d_3)\hspace{1.111pt}x_2^2 x_3^2 + 4 (a_1 d_2-b_1 c_2 )\hspace{1.111pt}x_2 x_3^3\nonumber \\ {}&\quad + (a_3 b_1 - a_1 b_3 - 4 b_1 c_3 + 4 a_1 d_3)\hspace{1.111pt}x_3^4, \end{aligned}$$
(11)

and \(P_3\) is equal to

$$\begin{aligned}&{} -(a_2 b_1 - a_1 b_2) (r_1^2 - r_2^2)^2 + 4 (b_2 c_0 - a_2 d_0) (r_1^2 + r_2^2)\hspace{1.111pt}x_1\nonumber \\ {}&\quad - 4 (b_1 c_0 - a_1 d_0) (r_1^2 + r_2^2)\hspace{1.111pt}x_2+ 2 (a_2 b_1 - a_1 b_2 + 2 b_2 c_1 - 2 a_2 d_1) (r_1^2 + r_2^2)\hspace{1.111pt}x_1^2\nonumber \\ {}&\quad - 4 (b_1 c_1 - b_2 c_2 - a_1 d_1 + a_2 d_2) (r_1^2 + r_2^2)\hspace{1.111pt}x_1 x_2 + 4 (b_2 c_3 - a_2 d_3) (r_1^2 + r_2^2)\hspace{1.111pt}x_1 x_3\nonumber \\ {}&\quad + 2 (a_2 b_1 - a_1 b_2 - 2 b_1 c_2 + 2 a_1 d_2) (r_1^2 + r_2^2)\hspace{1.111pt}x_2^2 - 4 (b_1 c_3 - a_1 d_3) (r_1^2 + r_2^2)\hspace{1.111pt}x_2 x_3 \nonumber \\ {}&\quad + 2 (a_2 b_1 - a_1 b_2) (r_1^2 - r_2^2)\hspace{1.111pt}x_3^2 + 4 (a_2 d_0-b_2 c_0 )\hspace{1.111pt}x_1^3 + 4 (b_1 c_0 - a_1 d_0)\hspace{1.111pt}x_1^2 x_2 \nonumber \\ {}&\quad + 4 (a_2 d_0-b_2 c_0 )\hspace{1.111pt}x_1 x_2^2 + 4 (a_2 d_0-b_2 c_0 )\hspace{1.111pt}x_1 x_3^2 + 4 (b_1 c_0 - a_1 d_0)\hspace{1.111pt}x_2^3\nonumber \\&\quad + 4 (b_1 c_0 - a_1 d_0)\hspace{1.111pt}x_2 x_3^2 + (a_1 b_2 -a_2 b_1 - 4 b_2 c_1 + 4 a_2 d_1)\hspace{1.111pt}x_1^4 \nonumber \\ {}&\quad + 4 (b_1 c_1 - b_2 c_2 - a_1 d_1 + a_2 d_2)\hspace{1.111pt}x_1^3 x_2 + 4 ( a_2 d_3-b_2 c_3 )\hspace{1.111pt}x_1^3 x_3 \nonumber \\ {}&\quad + 2 (a_1 b_2-a_2 b_1 - 2 b_2 c_1 + 2 b_1 c_2 + 2 a_2 d_1 - 2 a_1 d_2)\hspace{1.111pt}x_1^2 x_2^2\nonumber \\ {}&\quad + 4 (b_1 c_3 - a_1 d_3)\hspace{1.111pt}x_1^2 x_2 x_3 + 2 (a_1 b_2-a_2 b_1 - 2 b_2 c_1 + 2 a_2 d_1)\hspace{1.111pt}x_1^2 x_3^2 \nonumber \\ {}&\quad + 4 (b_1 c_1 - b_2 c_2 - a_1 d_1 + a_2 d_2)\hspace{1.111pt}x_1 x_2^3+ 4 ( a_2 d_3-b_2 c_3)\hspace{1.111pt}x_1 x_2^2 x_3 \nonumber \\ {}&\quad + 4 (b_1 c_1 - b_2 c_2 - a_1 d_1 + a_2 d_2)\hspace{1.111pt}x_1 x_2 x_3^2 + 4 (a_2 d_3-b_2 c_3 )\hspace{1.111pt}x_1 x_3^3\nonumber \\&\quad - (a_2 b_1 - 4 b_1 c_2 - a_1 (b_2 - 4 d_2))\hspace{1.111pt}x_2^4 + 4 (b_1 c_3 - a_1 d_3)\hspace{1.111pt}x_2^3 x_3 \nonumber \\ {}&\quad + 2 (2 b_1 c_2-a_2 b_1 + a_1 (b_2 - 2 d_2))\hspace{1.111pt}x_2^2 x_3^2 \nonumber \\&\quad + 4 (b_1 c_3 - a_1 d_3)\hspace{1.111pt}x_2 x_3^3 - (a_2 b_1 - a_1 b_2)\hspace{1.111pt}x_3^4. \end{aligned}$$
(12)

5 Proof of Theorem 1.5

In view of Theorem 1.1 the 2-dimensional torus \(\mathbb {T}^2\) in Cartesian coordinates can be written as the surface \(g_1=0\) with \(g_1\) as in (8). It follows from the proof of Theorem 1.4 that any polynomial vector field \(X=(P_1,P_2,P_3)\) of degree 4 having \(\mathbb {T}^2\) as an invariant surface must be written as in (10)–(12). Now it follows from the proof of Theorem 1.3 and the definition of invariant parallel that in order to obtain the most general polynomial vector fields having the maximum number of parallels (which is at most two) we must have that the polynomial \(P_1\) in (10) must be of the form

$$\begin{aligned} \begin{aligned} P_1 =(x_1 - \kappa _1)&(x_1 - \kappa _2)\\ {}&\cdot \bigl (s_0 + s_1 x_1 + s_2 x_2 + s_3 x_3+ s_4 x_1^2 \\ {}&\qquad + s_5 x_1 x_2 + s_6 x_1 x_3 + s_7 x_2^2 + s_8 x_2 x_3 + s_9 x_3^2\bigr ), \end{aligned} \end{aligned}$$

for some \(\kappa _1, \kappa _2, s_i \in \mathbb {R}\) for \(i=0,\ldots ,9\). Solving this equation for any \(\kappa _1, \kappa _2, s_i\) with we get that the unique possible solution is \(s_0=\cdots =s_9=0\) which is not possible because then \(P_1 =0\). So, there are no polynomial vector fields on \(\mathbb {T}^2\) of degree 4 having two invariant parallels. The most general form for a polynomial vector filed on \(\mathbb {T}^2\) of degree 4 having one parallel is

$$\begin{aligned} \begin{aligned} P_1&= (x_1 - \kappa ) \bigl (s_0 + s_1 x_1 + s_2 x_2 + s_3 x_3 + s_4 x_1^2 + s_5 x_1 x_2 + s_6 x_1 x_3 + s_7 x_2^2 \\&\qquad \qquad \qquad + s_8 x_2 x_3 + s_9 x_3^2 + s_{10} x_1^3 + s_{11} x_1^2 x_2+ s_{12} x_1^2 z + s_{13} x_1 x_2^2\\ {}&\qquad \qquad \qquad + s_{14} x_1 x_2 x_3 + s_{15} x_1 x_3^2 + s_{16} x_2^3 + s_{17} x_2^2 x_3 + s_{18} x_2 x_3^2 + s_{19} x_3^3\bigr ), \end{aligned} \end{aligned}$$

for some \(\kappa , s_i \in \mathbb {R}\) for \(i=0,\ldots , 19\) with \((s_0,\ldots ,s_{19}) \ne (0,\ldots ,0)\). Solving this equation we obtain many solutions. One of these solutions is the solution provided in the statement of the theorem.