Limit Cycles of Polynomially Integrable Piecewise Differential Systems

: In this paper, we study how many algebraic limit cycles have the discontinuous piecewise linear differential systems separated by a straight line, with polynomial ﬁrst integrals on both sides. We assume that at least one of the systems is Hamiltonian. Under this assumption, piecewise differential systems have no more than one limit cycle. This study characterizes linear differential systems with polynomial ﬁrst integrals.


Introduction
We will consider discontinuous piecewise linear differential systems (DPwLS) on the plane R 2 . On the half plane where x is negative they are expressed as: and where x is positive as: where A ± are real 2 × 2 matrices and b ± ∈ R 2 . For the definition of a DPwLS on x = 0, we follow Filippov's solution [1]. DPwLSs have been studied in depth [2]. An introduction to and a comprehensive list of references can be found in the books [3,4], and the survey [5].
Since planar linear differential systems have no limit cycles (isolated periodic orbits), the limit cycles of DPwLSs separated by a straight line must cross the straight line at two points. In this paper, we do not consider the possible limit cycles which have a segment on the discontinuous straight line, called sliding limit cycles.
The limit cycles of planar differential systems play a main role in understanding the dynamics of such systems, as well as for planar DPwLSs. Thus, the limit cycles of DPwLSs (1) and (2) have been studied intensively in the last twenty years. The current situation of proven bounds is summarized in [6].
One problem still to be solved is: "Is three the maximum number of limit cycles that a discontinuous piecewise linear differential system with a straight line of separation can have?" Recently, Buzzi, Gasull and Torregrosa analyzed the particular class of algebraic limit cycles in the DPwLS (1) and (2) [7]. They establish that a limit cycle is algebraic if "all its points, except the ones on the sliding set, are contained in the level sets of one or two polynomials". One of the main results of [7] is to show the existence of DPwLSs (1) and (2) with two algebraic limit cycles.
In order to deal with algebraic limit cycles for DPwLSs, we must work with linear differential systems with polynomial first integrals (PFI) on both sides of x = 0. Therefore, we need to identify and classify the planar linear differential systems with a PFI. To the best of the authors' knowledge, such a classification has not been done. In [8], the authors provide a characterization of all quadratic differential systems with a PFI. However, this is not applicable to our area of interest because they do not consider the cases where all the coefficients of the quadratic terms vanish at the same time. Below, we classify all the linear differential systems with PFIs. Theorem 1. Let us consider systemẋ = a + bx + cy, with at most one equilibrium point (the associated vector field has no common factors) and where b 2 + c 2 + e 2 + f 2 = 0. This system has a PFI H(x, y) if and only if one of the following conditions hold.
(ii) If f = −b, c = 0, ec = f b and there are two positive integers, p and q, such that p = q and ce = (pb (iii) If f b = 0, f 2 = b 2 and c = 0 and there are two positive integers p and q such that p = q and pb + q f = 0, then The main goal of this paper is to characterize the maximum number of limit cycles of DPwLSs such as (1) and (2) formed by two linear differential systems with PFI when at least one of these differential systems is a Hamiltonian system. Our main result is the following. Theorem 2. When both linear differential systems, (1) and (2), have a PFI, they have at most one limit cycle if only one of the two systems is Hamiltonian. If both systems are Hamiltonian, then the DPwLS has no limit cycles.
The rest of this paper is organized as follows. Section 2 shows a proof of Theorem 1 following arguments related with factorization and divisibility of polynomials. Section 3 gives the proof of Theorem 2, applying the first integrals of Theorem 1. Finally, in Section 4, we present a DPwLS such as (1) and (2) when both differential systems have a PFI and exactly one limit cycle.
In [9], they study the limit cycles of the discontinuous piecewise differential systems separated by one straight line and formed by two polynomial Hamiltonian systems, and consequently, such limit cycles are algebraic. While in this paper, only one of the systems is Hamiltonian, otherwise the piecewise differential system cannot have limit cycles.
Some authors are interested in knowing if the limit cycles of a discontinuous piecewise differential system persist when the piecewise differential is regularized (see [10]), or how many limit cycles can have such regularized piecewise differential systems (see [11]). For the discontinuous piecewise differential systems studied here, having one algebraic limit cycle, if they are regularized using the regularization of Sotomayor and Teixeira [12], the limit cycle persists but it is no longer algebraic.

Proof of Theorem 1
In order to prove Theorem 1, we must introduce a previous result: the polynomial resolution of polynomial differential equations of the form NH + UH y = 0, where N and U are polynomial and H is a polynomial solution of degree n. Proposition 1. We consider the differential equation where N and U are polynomials, non identically zero and coprime. If U = r ∏ i=1 P r i i where P i are the irreducible real factors of U, then (4) has a polynomial solution H of degree n, different from the trivial H = 0, if and only if there exists n 1 , n 2 , . . . , n r ∈ N such that Moreover, when the polynomial H exists, then n i deg P i , which does not depend on the variable y. If H is homogeneous, then U and W are homogeneous and W = γx k with γ ∈ R.
Proof. Since N and U are coprime polynomials and H must also be polynomial, it follows that U divides H. So, n 1 , n 2 , . . . , n r ∈ N such that H = RW and R = r ∏ i=1 P n i i with n i ≥ r i . Furthermore, we can assume that R and W are coprime. Taking into account these considerations in (4): To compute a PFI H of degree n of system (3), we use the decomposition in homogeneous parts of such a PFI. Proposition 2. We consider P(x, y) =ã +bx +cy and Q(x, y) =d +ẽx +f y with P · Q = 0. We suppose that the polynomial differential systeṁ has a PFI H of degree n. This can be expressed as where H j,y is the partial derivative of H j with respect to the variable y and P i is the homogeneous part of the polynomial P of degree i.

Proof.
We consider the partial derivatives of H, i.e., H x and H y . Thus: The Euler Theorem for homogeneous functions gives that Therefore, Multiplying Equation (7) by x and substituting xH x with the value given in (9): Finally, taking into account that P = P 0 + P 1 and xQ − yP = T 1 + T 2 , the homogeneous parts of (10), arranged from the greatest to the lowest degree provide system (6).

Remark 1.
If system (5) is homogeneous,ã =d = 0, any PFI H verifies that each homogeneous part of H also is a PFI of (5). Therefore, in homogeneous differential systems, it is logical to consider only homogeneous PFI. Corollary 1. If system (5) is homogeneous, then any homogeneous PFI H of degree n satisfies nPH Proof. The proof is simple, as H has only one homogeneous part of degree n, which is H itself. Thus, system (6) is reduced to the first equation. Since P 0 = T 1 = 0, P 1 = P and T 2 = xQ − yP, the proof follows.
Proof of Theorem 1. Let us distinguish several cases, taking into account the value of c.
However, ifd =ẽ = 0, then d = f a/c and e = f b/c. So, Q = f P/c with f ∈ R and system (3) will have common factors, in contradiction with the hypotheses.
Subcase (I.1):f = 0. Then, f = −b, and the variables in system (12) can be separated. Thus, the first integral is By undoing the change of variables (11), the first integral H 1 (x, y) is Multiplying this expression by two and removing the constant term, gives Statement (i) of Theorem 1 when c = 0. Subcase (I.2):f = 0 andẽ = 0. Then, Considering the new variables in system (12) System (16) is homogeneous and can be applied to Corollary 1. Therefore, we must solve As (17) has a polynomial solution, T factorizes as T = (Y + αX)(Y + βX). We suppose that T does not factorize. From Proposition 1, in order to have a PFI of (17), the existence of p ∈ Z + is necessary such that 2p ≤ n and H = T p X n−2p and Thus, n = 2p andf = 0, should be imposed. However, this contradicts our assumptions. Therefore, we must suppose that T factorizes, which means that Keeping in mind that we are studying the casef = 0 andẽ = 0, α + β = 0 and αβ = 0, Proposition 1 gives the PFI of (17) where p, q ∈ Z + , 2 ≤ p + q ≤ n, and Taking this into account, Considering (18), (19) and (20) all together, it can be concluded that In conclusion, one PFI of system (16) is because we have (19), (20), (21), (22) and we can reject multiplicative constants, such as (−1) p . The first integral of the original system (3) appears by undoing the changes of variables (11) and (15). So However, Taking all this into account, Analogously, Finally, condition (22) becomes This proves statement (ii) of Theorem 1.
Proposition 2 can be applied to solve system (12) taking P = P 1 = cY and Q =d +f Y.
and consequently, The first equation of (6) can be written in this case as So dividing by Y: From Proposition 1, we know that there is a polynomial solution H n if and only if there is p ∈ N such that p ≤ n and nc − pc = 0. In addition, in this case, However, these conditions imply that (n − p)c = 0, or equivalently, n = p and therefore, Using this relation in the second equation of system (6) It follows easily that Y should divide the right side of this equality, which leads to a contradiction because from (23),f = 0 and c = 0. Therefore, in this case, no PFI exists. Case (II): c = 0. Changing variables X = y and Y = x to system (3) giveṡ Two subcases can be identified. Subcase (II.1):c = 0, which agrees with case (I) previously discussed. Therefore, the PFI exists.
By undoing the change of variables applied in order to obtain system (24), the condition characterizing this case translates to b = − f , and the first integral can be written as Therefore, statement (i) of Theorem 1 is verified when c = 0. Thus, together with subcase (I.1) this concludes the proof of subcase (II.1.1). Subcase (II.1.2):f = −b andfb = 0. This subcase coincides with conditions (14) in Subcase (I.2). Therefore, in order to have a PFIH, there must be a p, q ∈ N such that p = q, The change of variables is now undone. From (24), the conditions are translated to b = f and b f = 0. Furthermore, p and q satisfy that We assume now that (25) is satisfied because pb + q f = 0. Hence, f = b, because n = p + q ∈ Z + is the degree of H. It can be concluded that and therefore, Taking into account these relations, + a), and In conclusion, under our assumptions Following similar computations, if (25) is satisfied from the assumption that p f + qb = 0, the same expression for H(x, y) is obtained. This concludes the proof of statement (iii) of Theorem 1.
Subcase (II.2):ē = 0 andc = 0. This is the last subcase to consider to finish the proof. If we undo the change of variables taking into account (24), system (3) can be written aṡ x = a + bx,ẏ = d + f y, and the general hypothesis is reduced to b 2 + f 2 = 0.
This shows that, in fact, we are only interested in the case b f = 0. We assume, contrary to our claim, that b = 0. Hence, a f = 0 in order to avoid common factors in the differential system, as the variables can be separated in the system, Integrating this equality: where k is a constant. Straightforward computations provide the relation Therefore, a PFI does not exist. Analogously, it can be shown that the PFI cannot be found for the case f = 0. Therefore, in order for a PFI to exist, there must be b f = 0. However, if b = − f it corresponds to statement (i) of Theorem 1, whereas if b = − f it corresponds to statement (iii) of Theorem 1 for c = e = 0.

Proof of Theorem 2
Theorem 2 focuses on giving bounds to the number of limit cycles of DPwLS (1) and (2). Therefore, although it is not necessary, in order to reduce the computations solving these bounds, we shall apply Theorem 1 to the canonical forms introduced in [13].
From [13], it follows that there is a topological equivalence between the DPwLS (1) and (2) and the DPwLS (26) and (27). Consequently, their phase portraits are also equivalents, taking orbits into orbits and remaining invariant {x = 0}. This must be done while avoiding orbits, which pass through sliding sets of these systems.
Therefore, we shall now study the PFI of the canonical differential systems (26) and (27) using Theorem 1.
where l, s, t ∈ R and α ∈ {i, 0, 1}. Then, (28) has a PFI, H(x, y), in the following cases only: (i) l = 0 and in this case (ii) l = q−p q+p = 0 with p, q ∈ Z + and α = 1. In this case, Proof. Theorem 1 implies that we should consider two cases, l = 0 and l = 0. If l = 0, then system (28) satisfies the condition f = −b = 0 of statement (i) of Theorem 1, and (29) is straightforward from that statement.
If l = 0, as in systems (28) and (3) of Theorem 1, we obtain that a = s, f = 0 = −b = −2l, c = −1 = 0 and e = l 2 − α 2 . Therefore, the existence of a PFI is satisfied only under the conditions of statement (ii) of Theorem 1. Hence, the condition ce = b f should be studied, where ce = α 2 − l 2 and b f = 0.
It follows easily that α = ±l.
Furthermore, for the case p, q ∈ Z + , such that p = q and ce = (pb + q f )(p f + qb) (q − p) 2 , the right hand side satisfies So from (31): However, this means that Therefore, in this case, there is a PFI if and only if l 2 = (q − p) 2 (q + p) 2 α 2 or, equivalently, System (28) has real coefficients, so l ∈ R, and since l = 0, it follows that α = 0 and α = i. Thus, α = 1. Therefore, from statement (ii) of Theorem 1, if a PFI exists it must be If l = q−p q+p , then the first integral H is written Likewise, if l = p−q q+p , then the first integral H becomes In fact, (32) and (33) are the same PFI with p and q reversed, and multiplying H(x, y) by (−1) p+q , gives (30). This completes the proof of Proposition 3.

Remark 2.
Cases (i.1) and (ii.1) are Hamiltonian cases. Any system of case (i.2) has a saddle point , and its separatrices cut x = 0 at 0, − h q and 0, h p . Systems of cases (ii.2) also have a saddle point, located at , and its separatrices cut x = 0 at 0, −h q + j and 0,h p + j .
Focusing again on the location of piecewise limit cycles, we start with some geometrical ideas. Under the assumptions of Theorem 1, let H − (x, y) (equivalently, H + (x, y)) be a PFI of the linear system in x ≤ 0 (equivalently, x ≥ 0). Any limit cycle must intersect the straight line x = 0 at points (0, y) and (0, Y) with y = Y such that Hence, if we count the pairs of solutions (y, Y) we can give an upper bound to the number of limit cycles of a piecewise differential system under the hypotheses of Theorem 2. However, this is only the upper bound because the connection between branches of the first integrals do not provide a closed curve, or a closed curve which, is not a periodic orbit, because the two pieces are not oriented in the same direction. Some examples of these phenomena can be seen in Figure 1. Below these results are applied to the proof of Theorem 2. (26) and (27) with a PFI on both sides of Σ = {x = 0}. If one of the first integrals corresponds to a linear differential system with a saddle, γ intersects Σ at two points located between the two points of Σ, which belong to the separatrices of the saddle.

Proposition 4. Let γ be a limit cycle of a DPwLS
Proof. As a linear differential system, without common factors and having a PFI, it is topologically equivalent to a linear Hamiltonian system (see Proposition C in [14]), the ω and α-limits of the orbits in the saddle case are restricted to the limits of the separatrices. Hence, any orbit out of its separatrices and far from the equilibrium point has a similar behavior to those which are two straight lines, according to Corollary 2. This implies that any orbit will cross Σ twice if and only if both separatrices cross Σ and the orbit is located at the hyperbolic region between the branches of the separatrices crossing Σ. See Figure 2. As far as f p,α (x) > 0 for all x, f p,α (x) > 0 for (x − α)(x + α) > 0 and 2(x − pα) > 0, or (x − α)(x + α) < 0 and 2(x − pα) < 0. In the first case, if x ∈ (−∞, −α) ∪ (α, ∞) and x < pα, then f p,α (x) > 0 if x ∈ (−∞, −α) ∪ (α, pα). In the second case, f p,α (x) > 0 if x ∈ (−α, α) and x > pα. However, pα ≥ α, and since p ∈ Z + and α > 0, then there is no other solution for x where f p,α (x) > 0.
Remark 3. Figure 3 shows graphical representations of the results obtained in this proof.
Proof of Theorem 2. Taking into account Corollary 2, it is enough to check Theorem 2 for the planar DPwLS (26) and (27). We divide the proof into three cases according to Corollary 2, which controls when the linear differential systems (26) and (27) have PFI.
using the notation of Corollary 2.
We are only interested in the solutions in which y = Y. System e 1 = 0, e 2 = 0 either has no solutions, or has an infinite number of solutions when j = 0. Consequently, there are no isolated solutions, and therefore, in this case, the DPwLS (26) and (27) have no limit cycles.
The proof is completed by showing that the graphs of f p,α (x) and (−1) p+q f q,β (x) cut each other in one non-vanishing value of x ∈ (−α, β), at most. In order to check this, we must take into account the parity of p and q and the relative positions of α and β. Lemma 1 is the key to this analysis.
Nevertheless, we only need to consider one case: p and q even. In Statements (ii) and (iii) of Theorem 1, without loss of generality, we can assume that p and q are both even. On the contrary, p = 2p and q = 2q are both even, satisfying the same hypotheses of the theorem for the same differential system and giving a PFI, H j , such that H j = (H j ) 2 for any j = 2, 3.
If β < α, similar arguments can be developed, but analyzing the functions at the intervals (−α, −β) and (−β, β) separately. This completes the desired conclusion, with at most one limit cycle.
Case 3: Only system (27) is Hamiltonian. Again, from Proposition 3, in system (27) r = 0 and in system (26) α = 1 and = q−p q+p = 0 with p, q ∈ Z + . In this case, every limit cycle of the DPwLS (26) and (27) crosses x = 0 at two different points, (0, y) and (0, Y), satisfying the system Similar arguments as the ones used in Case 2 show that DPwLS (26) and (27) have at most one limit cycle. Therefore, we have completed the proof of Theorem 2.

Examples
In this section, we show that the bound obtained in Theorem 2 can be achieved.
a, d ∈ R and the piecewise linear system given by if x ≤ 0, and ẋ y if x ≥ 0. System (36) satisfies the hypotheses of Theorem 1 statement (i). It means that System (36) is a Hamiltonian system and has H − = 3x 2 + y 2 − 4xy + 2x − 2y as a first integral. Moreover, this system has a saddle located at (−1, −1) and its separatrices are y = x (unstable) and y = 3x + 2 (stable). These separatrices cut the vertical axis at (0, 0) and (0, 2). System (37) satisfies the hypotheses of Theorem 1 statement (ii) with p = 1 and q = 3. Thus, system (37) has the PFI This shows that this system has a saddle located at 2a−4d 3 , 2d−4a 3 and its separatrices are y = −x − 2 3 (a + d) (stable) and y = x − 2(a − d) (unstable). These separatrices cut the vertical axis at (0, − 2 3 (a + d)) and (0, −2(a − d)). We denote γ = 2 3 (a + d) and θ = 2(a − d). In this way, as mentioned before, we can characterize the limit cycles solving system where y 1 and y 0 are unknown and identify points at Σ 0 = {(x, y) ∈ R 2 : x = 0} that characterize both level curves completing the cycle, if one exists. If we compute the resultant of both left-hand side expressions with respect to y 1 , we conclude that, in order to have a limit cycle, a necessary condition is that y 0 satisfies the equation The discriminant of this quadratic equation is D(γ, θ) = −4(1 + θ) 2 (4 + 3γ + θ)(4 + γ + 3θ).  As (0, y 0 ) is an intersection point of the limit cycle with Σ 0 and any limit cycle requires two of these points, we look for the region where R(y 0 ) = 0 has two real different solutions. This means that we are interested in D(γ, θ) > 0, or equivalently, (4 + 3γ + θ)(4 + γ + 3θ) < 0.

Discussion
We have illustrated how to study the limit cycles of piecewise differential systems separated by one straight line and formed by two integrable systems. Here, we have considered that the first integrals of both differential systems are polynomials with one of the differential systems being a Hamiltonian system, and consequently, if the piecewise differential system has limit cycles, these are algebraic. Under this assumption, the piecewise differential system has no more than one limit cycle. Additionally, we have characterized the linear differential systems with polynomial first integrals.
Author Contributions: B.G., J.L., J.S.P.d.R. and S.P.-G. contributed equally to this work. All authors have read and agreed to the published version of the manuscript.
Funding: The first, third, and fourth authors are partially supported by grant MCI-21-PID2020-113052GB-I00 of the Spanish Agencia Estatal de Investigación. The second author is partially supported by the Agencia Estatal de Investigación grant PID2019-104658GB-I00, the H2020 European Research Council grant MSCA-RISE-2017-777911, AGAUR (Generalitat de Catalunya) grant 2022-SGR 00113, and by the Acadèmia de Ciències i Arts de Barcelona.