This is a preprint of: “Discrete Melnikov functions”, Armengol Gasull, Clàudia Valls, J. Difference Equ. Appl., 1–14, 2021. DOI: [10.1080/10236198.2021.1970147] DISCRETE MELNIKOV FUNCTIONS ARMENGOL GASULL AND CLAUDIA VALLS Abstract. We consider non-autonomous N -periodic discrete dynamical systems of the form rn+1 = Fn (rn , ε), having when ε = 0 an open continuum of initial conditions such that the corresponding sequences are N -periodic. From the study of some varia- tional equations of low order we obtain successive maps, that we call discrete Melnikov functions, such that the simple zeroes of the first one that is not identically zero control the initial conditions that persist as N -periodic sequences of the perturbed discrete dynamical system. We apply these results to several examples, including some Abel- type discrete dynamical systems and some non-autonomous perturbed globally periodic difference equations. 1. Introduction and statement of the main results The interest on the study non-autonomous periodic discrete dynamical systems has been increasing in the last years, among other reasons, because they are good models for describing the dynamics of biological and ecological systems that vary periodically, either due to external disturbances or for effects of seasonality, see for instance [2, 11, 12, 13, 15, 16, 17] and the references therein. Consider non-autonomous discrete dynamical systems of the form rn+1 = fn (rn ), rn ∈ Rd , n ∈ N, (1) where d ∈ N+ , and fn is an N -periodic sequence of real smooth invertible such that fm = fm+N for all m ∈ N. Here, fn : U ⊂ Rd → U being U an open set of Rd . Given an initial condition r0 = ρ ∈ U we will denote by rn = ϕn (ρ) the sequence defined by (1). For convenience, for n > 0, we write fn,n−1,...,1,0 = fn ◦ fn−1 · · · ◦ f1 ◦ f0 . Then, for n > 0, rn = ϕn (ρ) = fn−1,n−2,...,1,0 (ρ). (2) It is well-known that given an N -periodic discrete dynamical system (1), it can be understood via the so called composition map fN −1,N −2,...,1,0 . For instance, if all maps share a common fixed point, the nature of this steady state point can be studied through the nature of this fixed point for fN −1,N −2,...,1,0 , see [2, 6]. Similarly, the attractor of a periodic discrete dynamical system (1) is the union of attractors of some composition maps, see [13, Thms. 3 and 6]. To find N -periodic solutions of (1) is equivalent to find solutions of ϕN (ρ) = ρ, or equivalently of the equation fN −1,N −2,...,1,0 (ρ) = ρ. Usually, is not easy to deal with it. The main goal of this paper is to give an alternative and indirect mechanism to study this problem for a special class of discrete dynamical systems. More specifically, it is 2010 Mathematics Subject Classification. Primary 37H20. Secondary 39A28. Key words and phrases. Discrete non-autonomous dynamical systems; Periodic sequences; Melnikov functions; Difference equations; Bifurcation. 1 2 A. GASULL AND C. VALLS said that (1) is globally N -periodic in U when for all r0 = ρ ∈ U it holds that ϕN (ρ) = ρ. We will consider N -periodic perturbed discrete dynamical systems of the form rn+1 = Fn (rn , ε) = fn (rn ) + εgn (rn ) + ε2 hn (rn ) + O(ε3 ), n ∈ N, r ∈ Rd , (3) where for ε = 0 it is globally N -periodic and ε ∈ R is a small parameter. Here Fn are N -periodic and of class C 3 (U × I), for I a small open interval containing 0. In other words, we want to determined which of the continuum of periodic sequences of the unperturbed dynamical system (3) with ε = 0, remain as isolated periodic sequences of (3) when ε 6= 0 is small enough. With this aim we adapt to this setting the use of variational equations, that was introduced by Poincaré for studying similar questions for ordinary differential equations. As we will see, we obtain some functions of ρ, Mi (ρ), for i ∈ N such that their simple zeroes give rise to the searched N -periodic sequences. These functions can be seen as a kind of Melnikov functions for discrete dynamical systems. Let φn (ρ, ε) be the sequence solution of (3) such that φ0 (ρ, ε) ≡ ρ ∈ U. It can be written as rn = φn (ρ, ε) = ϕn (ρ) + un (ρ)ε + vn (ρ)ε2 + O(ε3 ), (4) for some sequences un (ρ), vn (ρ) such that u0 (ρ) ≡ v0 (ρ) ≡ 0. We define M1 (ρ) = uN (ρ) and call it the first discrete Melnikov function for the discrete dynamical system (3). When M1 = 0, then M2 (ρ) = vN (ρ) is the second discrete Melnikov function. In a sufficiently enough smooth setting, the j-th discrete Melnikov can be similarly defined when all previous Melnikov functions identically vanish. Our first result gives a closed expression for M1 and M2 . Given a smooth function F : Rd → Rd we will denote by DF its Jacobian matrix and D2 F its Hessian matrix. We will use P P the following notation: given x ∈ Rd and a d × d matrix C = (ci,j ) then x Cx = i j ci,j xi xj , where xT is the transpose vector of x. T Theorem 1. Let rn = φn (ρ, ε) be the sequence (4) generated by (3). Assume that ϕN (ρ) ≡ ρ for all ρ ∈ U and all fn are invertible in U. Then the first two discrete Melnikov functions associated to (3) are N X −1 −1 M1 (ρ) = Dϕj (ρ) gj (ϕj (ρ)), j=0 N X −1 −1  1 T  M2 (ρ) = Dϕj (ρ) uj (ρ)D2 fj (ϕj (ρ))uj (ρ) + Dgj (ϕj (ρ))uj (ρ) + hj (ϕj (ρ)) , j=0 2 where u0 (ρ) = 0 and for j > 0, j−1 ! X −1 uj (ρ) = Dϕj (ρ) Dϕk (ρ) gk (ϕk (ρ)) . k=0 Moreover, for ε sufficiently small and any j ∈ {1, 2}, each simple zero of Mj , ρ = ρ∗ ∈ U gives rise to an isolated N -periodic sequence of (3). This periodic sequence has an initial condition r0 = R(ε) such that limε→0 R(ε) = ρ∗ . After looking to our proof it will clear that the same approach allows to get similar expressions for some more Mj , j > 2. We do not include their expressions for the sake of DISCRETE MELNIKOV FUNCTIONS 3 shortness. In the particular case fn (r) ≡ r for all n, then ϕn (ρ) ≡ ρ and the expressions of Mi are much simpler. In the following proposition we give them for i = 1, . . . , 3. Proposition 2. Consider the class C 4 , N -periodic discrete dynamical system rn+1 = rn + εgn (rn ) + ε2 hn (rn ) + ε3 kn (rn ) + O(ε4 ), n ∈ N, r ∈ U ⊂ Rd , with ε small enough. Then N X −1 M1 (ρ) = gj (ρ), j=0 N X −1   M2 (ρ) = Dgj (ρ)uj (ρ) + hj (ρ) , j=0 N X −1   1 T M3 (ρ) = uj (ρ)D2 gj (ρ)uj (ρ) + Dgj (ρ)vj (ρ) + Dhj (ρ)uj (ρ) + kj (ρ) , j=0 2 where u0 (ρ) = v0 (ρ) = 0 and for j > 0, j−1 j−1   X X uj (ρ) = gk (ρ) and vj (ρ) = Dgk (ρ)uk (ρ) + hk (ρ) . k=0 k=0 Moreover, including also M3 , the same conclusions that in Theorem 1 hold. In fact, this paper can be seen as an extension of the results and ideas introduced in [9] for studying isolated periodic solutions of T -periodic non-autonomous differential equations to N -periodic discrete dynamical systems. As an example of the similarities of the results obtained we recall the first Melnikov function given there when studying the T -periodic in time differential equation dr = f (t, r) + εg(t, r) + O(ε2 ). dt It is Z T −1 M1 (ρ) = Dρ ϕ(t, ρ) g(t, ϕ(t, ρ)) dt, 0 where ϕ(t, ρ) is the solution of the above differential equation when ε = 0 and such that ϕ(0, ρ) ≡ ρ. Compare with the expression of M1 given in Theorem 1. It is clear, that both could be obtained simultaneously by using all the machinery of time scales, see again [3] and [4, 5]. The proof of Theorem 1 is given in Section 2. The proof of Proposition 2 is similar and it is omitted for the sake of shortness, see Section 2.1. In Section 3 we present several examples of application, including Abel type discrete dynamical systems and some perturbed globally periodic difference equations. 4 A. GASULL AND C. VALLS 2. Proof of the main results Proof of Theorem 1. Write φn (ρ, ε) = ϕn (ρ) + εpn (ρ, ε), as in (4), where pn (ρ, ε) = un (ρ) + εvn (ρ) + O(ε2 ). By imposing that rn = φn (ρ, ε) satisfies (3) we get the iden- tity     φn+1 (ρ, ε) =Fn φn (ρ, ε), ε = fn φn (ρ, ε) + gn φn (ρ, ε) ε + hn φn (ρ, ε) ε2 + O(ε3 ) ε2 =fn (ϕn (ρ)) + εDr fn (ϕn (ρ))pn (ρ, ε) + pTn (ρ, ε)Drr fn (ϕn (ρ))pn (ρ, ε) + O(ε3 )  2  + gn (ϕn (ρ)) + εDr gn (ϕn (ρ))pn (ρ, ε) + O(ε2 ) ε  + hn (ϕn (ρ)) + O(ε) ε2 + O(ε3 ). By collecting the terms in ε0 , ε and ε2 into the above expression, we obtain the unperturbed difference equation (1) and two new linear N -periodic difference equations (the variational equations of first and second order) with unknowns un (ρ) and vn (ρ) and initial conditions u0 (ρ) ≡ v0 (ρ) ≡ 0, ϕn+1 (ρ) = fn (ϕn (ρ)), un+1 (ρ) = Dfn (ϕn (ρ))un (ρ) + gn (ϕn (ρ)), (5) 1 vn+1 (ρ) = Dfn (ϕn (ρ))vn (ρ) + uTn (ρ)D2 fn (ϕn (ρ))un (ρ) 2 +Dgn (ϕn (ρ))un (ρ) + hn (ϕn (ρ)). (6) Let us recall how to solve the non-autonomous linear difference equation xn+1 = An xn + bn , x0 = 0, where xn , bn ∈ Rd and An are d × d real matrices, see for instance [10]. By direct substitution, for n > 0, n−1 X xn = An−1 An−2 · · · Aj+2 Aj+1 bj , j=0 where by the sake of notation, when j = n − 1, the term in the above sum is simply bn−1 . If we assume that all Aj are invertible, then n−1 ! X −1 xn = An−1 An−2 · · · A1 A0 Aj Aj−1 · · · A1 A0 bj . j=0 Let us apply the above formula to (5). Notice that Aj = Dfj (ϕj (ρ)). Thus, by the chain rule, An−1 An−2 · · · A1 A0 = Dfn−1 (ϕn−1 (ρ))Dfn−2 (ϕn−2 (ρ)) · · · Df1 (ϕ1 (ρ))Df0 (ϕ0 (ρ)) = Dfn−1 (fn−2,n−3,...,1,0 (ρ))Dfn−2 ((fn−3,n−4,...,1,0 (ρ)) · · · Df1 (f0 (ρ))Df0 (ρ) = Dfn−1,n−2,...,1,0 (ρ) = Dϕn (ρ). DISCRETE MELNIKOV FUNCTIONS 5 As a consequence n−1 ! X −1 un (ρ) = Dϕn (ρ) Dϕj (ρ) gj (ϕj (ρ)) . j=0 In particular for n = N, since ϕN (ρ) ≡ ρ, N X −1 −1 M1 (ρ) = uN (ρ) = Dϕj (ρ) gj (ϕj (ρ)), j=0 as we wanted to prove. Notice that derivating with respect to ρ, ϕn+1 (ρ) = fn (ϕn (ρ)), and using that ϕN (ρ) ≡ ρ, we arrive to Dϕn+1 (ρ) = Dfn (ϕn (ρ))Dϕn (ρ), with Dϕ0 (ρ) = Id, proving that Dϕn (ρ) is a fundamental matrix of (5) and providing an equivalent way to obtain un (ρ). It is clear that doing similar computations we can obtain the solution of (6) and the expression of M2 (ρ), given in the statement. We omit the details. To end the proof, let us show that each simple zero of M1 (ρ) gives rise, for ε sufficiently small, to an isolated N -periodic solution of system (3). From (4), we have that  ϕN (ρ, ε) = 2 ∗ ∗ ∗ ρ + εM1 (ρ) + O(ε ) and let ρ be such that M1 (ρ ) = 0 and det DM1 (ρ ) 6= 0. Then ϕN (ρ, ε) − ρ Π(ρ, ε) = = M1 (ρ) + O(ε). ε We know that  Π(ρ∗ , 0) = 0 and DΠ(ρ, 0) = DM1 (ρ∗ ). ρ=ρ∗  Then, since det DM1 (ρ∗ ) 6= 0, from the implicit function theorem the result follows. When M1 (ρ) ≡ 0 for we can apply the same argument to M2 by considering b ε) = ϕN (ρ, ε) − ρ = M2 (ρ) + O(ε). Π(ρ, ε2 This completes the proof.  2.1. Relation between Theorem 1 and Proposition 2. Consider the discrete dyn- amical system (3). Let Φn be a family of invertible smooth diffeomorphism and define the new sequence sn , n ≥ 0, by the equation rn = Φn (sn ). Then straightforward compu- tations give that   sn+1 =Φ−1 −1 2 n+1 Fn (Φn (sn ), ε) = Φn+1 fn (Φn (sn )) + εgn (Φn (sn )) + O(ε )    =Φ−1 −1 n+1 fn (Φn (sn ) + εDΦn+1 (fn Φn (sn ) gn Φn (sn ) + O(ε ). 2 If we take as special family of diffeomorphisms the solution of the unperturbed dyna- mical system, that is Φn = ϕn , notice that by (2),   Φ−1 −1 −1 n+1 fn (Φn (sn ) =ϕn+1 fn (ϕn (sn ) = (fn,n−1,...,1,0 ) (fn (fn−1,n−2,...,1,0 (sn ))) =(fn,n−1,...,1,0 )−1 (fn,n−1,...,1,0 (sn )) = sn . 6 A. GASULL AND C. VALLS Hence (3) can always be written as   sn+1 = sn + εDϕ−1 2 n+1 (fn ϕn (sn ) gn ϕn (sn ) + O(ε ) and Theorem 1 and Proposition 2 can be deduced one from the other. 3. Applications 3.1. Abel type discrete dynamical systems. It is well-know, see for instance [3], that the 1-dimensional discrete dynamical version of the Riccati differential equation dr dt = a(t) + b(t)r + c(t)r2 is an + bn rn rn+1 = . cn + d n r n The main reason is that in the two cases, the continuous and discrete flows are given by Möbius transformations. For this cause, both equations, assuming T -periodicity in the first case or that the four sequences are N -periodic in the second case, have at most 2 isolated T or N periodic solutions, respectively. In fact, both cases can be simultaneously studied by using the time scales setting, see again [3]. For similarity, we consider as a discrete version of the Abel differential equation dr dt = a(t) + b(t)r + c(t)r2 + d(t)r3 the discrete dynamical system an + bn rn rn+1 = . (7) cn + dn rn + en rn2 In this section, as an application of Theorem 1, we reproduce some results of [3]. We prove that when the five sequences defining (7) are N -periodic there are examples of this dynamical system having at least N − 1 isolated N -periodic orbits. As a consequence, in contrast of what happens for the Riccati case, there is no upper bound for the number of isolated periodic sequences generated by general discrete dynamical systems of the form (7). This result is a natural extension of a similar property that holds for T - periodic Abel differential equations, proved in the pioneering work [14]. We will prove for (7) the above result by studying the first order discrete Melnikov function M1 associated to the particular family rn rn+1 = , (8) 1 + dn rn + εen rn2 with Pk−1dn and en , N -periodic sequences and such that DN = 0, where for k > 0, Dk = j=0 dj , D0 = 0 and ε is a small parameter. When ε = 0, (8) is a Riccati equation and the sequences generated by it such that r0 = ρ, are given by the Möbius maps ρ rn = ϕn (ρ) = , n ≥ 0. 1 + Dn ρ Notice that this unperturbed dynamical system is globally periodic in a neighborhood of 0, because ϕN (ρ) = 1+Dρ N ρ = ρ. Moreover, rn rn en rn3 rn+1 = Fn (rn , ε) = = − ε + O(ε2 ). 1 + dn rn + εen rn2 1 + dn rn (1 + dn rn )2 DISCRETE MELNIKOV FUNCTIONS 7 Hence, in the notation of Theorem 1, r en r 3 fn (r) = , gn (r) = − . 1 + dn r (1 + dn r)2 Thus, since ϕ0n (ρ) = (1 + Dn ρ)−2 , N X −1 N X −1 −1 ej r3 M1 (ρ) = ϕ0j (ρ) gj (ϕj (ρ)) =− (1 + Dj ρ)2 j=0 j=0 (1 + dj r)2 r=ϕj (ρ) N X −1 1 + Dj ρ = −ρ3 ej . j=0 (1 + Dj+1 ρ)2 Therefore, the number of simple isolated zeroes of the above function in a suitable open interval U = (0, R) will give the same number of periodic sequences of (8), for ε small enough. Although it is not difficult to study this number (bellow we will recall a well- known procedure to have lower bounds for it) we prefer to take advantage of the idea introduced in Section 2.1 to simplify the problem. With this aim, and following the notation of that section we introduce the new variables sn as rn = Φ(sn ) = 1/sn . Notice that here, Φ(s) = 1/s is independent on n. With these variables (8) writes as en sn+1 = sn + dn + , (9) sn and the initial condition is s0 = 1/ρ = %. Using again the notation of Theorem 1 we obtain that sn = ϕn (%) = % + Dn , fn (s) = s + dn and gn (s) = en /s. c1 , is In these new variables, the discrete Melnikov function, say M N X −1 N X −1 −1 1 c1 (%) = M ϕ0j (%) gj (ϕj (%)) = ej j=0 j=0 % + Dj and we are interested in its zeroes in a suitable neighborhood of infinity. Notice that M1 and Mc1 are quite similar, but different due to the action of the diffeomorphism Φ. We continue our study with the second one because it is simpler. It is convenient to use the following lemma, proved in [8]: Lemma 3. Let hj : U ⊂ R → R, j = 0, 1, . . . N − 1, be N linearly independent functions. (i) Given N − 1 arbitrary values xj ∈ U, j = 1, 2, . . . N there exist N constants cj , j = P −1 0, 1, . . . , N −1 such that h(x) = N j=0 cj hj (x) is not the zero function and h(xj ) = 0 for j = 1, 2, . . . , N − 1. (ii) Furthermore, if all hj are analytic in U and there exits one of them that has constant sign in U, it is possible to obtain an h of the above form such that it has at least N − 1 simple zeroes in U. If we take all Dj , j = 0, 1, . . . , N − 1, different it is not difficult to see that all the functions hj (x) = 1/(x + Dj ) are linearly independent. By applying Lemma 3 to M c1 we obtain that we can take suitable ej such that the corresponding function has N − 1 simple zeroes in a given neighborhood of infinity, as we wanted to prove. By Theorem 1, 8 A. GASULL AND C. VALLS these zeroes give rise to the desired N − 1 isolated N -periodic sequences for discrete dynamical systems of type (7). 3.2. Polynomial type discrete dynamical systems. Recall that by Proposition 2 the formulas of Mj are simpler when the unperturbed discrete dynamical system is rn+1 = rn . Moreover, when d = 1 and F is a polynomial in r of degree ` the computation of the discrete Melnikov functions simplify even more. Consider rn+1 = Fn (rn , ε) = rn + εgn (rn ) + ε2 hn (rn ) + ε3 kn (rn ) + O(ε4 ) where all gn (r), hn (r) and kn (r) are polynomials of degree ` and the three sequences are N -periodic. By Proposition 2 we obtain that M1 , M2 and M3 are polynomials of degree at most `, 2` − 1 and 3` − 2, respectively. These values are in consequence the maximum number of isolated N -periodic sequences that can be constructed with our approach. Let us discuss if these maximum values can be achieved. It is clear that there are examples PN −1 where M1 has exactly degree ` and it has ` simple real roots, because M1 (ρ) = j=0 gj (ρ) and all the gj are polynomials in ρ. To study M2 recall that we have to assume that M1 = 0. We write each polynomial gj as gj (ρ) = g j r` + Qj (ρ), for some polynomials Qj of degree at most ` − 1. Hence, in PN −1 particular, j=0 g j = 0. Moreover, from the expression of M2 we have that N X −1  j−1 X  N X −1  j−1 X  M2 (ρ) = gj0 (ρ) gk (ρ) + hj (ρ) =` gj g k ρ2`−1 + R2`−2 (ρ), j=0 k=0 j=0 k=0 where R2`−2 is a polynomial of degree at most 2` − 2. Hence it is clear that the values g j can be taken such that M1 = 0 and M2 has exactly degree 2` − 1. It can be seen that to have an example such that M2 has exactly 2` − 1 real roots if suffices to consider gj and hj , j = 0, 1, . . . N − 1, of the form gj (r) =g j r` + c`−1 r`−1 + c`−2 r`−2 + · · · + c2 r2 + c1 r + c0 , hj (r) =d` r` + d`−1 r`−1 + d`−2 r`−2 + · · · + d2 r2 + d1 r + d0 , for some suitable constants. To study the actual degree of M3 we need a preliminary result. Lemma 4. Given any sequence fj , j ∈ N and 0 < n ∈ N it holds that n−1 n−1 j−1 n−1 !2 X X X X fj2 + 2 fj fk = fj , j=0 j=0 k=0 j=0 P−1 where by the way of notation k=0 fk = 0. Proof. Consider an arbitrary sequence Fj , j ∈ N. As usual, ∆Fj = Fj+1 − Fj . Clearly, (∆Fj )2 + 2Fj ∆Fj = Fj+1 2 − Fj2 . DISCRETE MELNIKOV FUNCTIONS 9 Summing both sides of the above equality from j = 0 until j = n − 1 and taking into account that the right-hand side is a telescopic sum, we obtain that n−1 X n−1 X (∆Fj )2 + 2 Fj ∆Fj = Fn2 − F02 . j=0 j=0 P By considering F0 = 0 and for j > 0, Fj = j−1 k=0 fk we have that ∆Fj = fj . Replacing these values in the above equality we obtain the result of the statement.  Recall that M3 is only defined when M1 = M2 = 0. Then it holds that NX−1 N X −1  j−1 X  g j = 0 and gj g k = 0. j=0 j=0 k=0 Pn−1 2 Hence, applying the above lemma to fj = g j , j = 0, 1, . . . N −1, we obtain that j=0 gj = 0. Thus all g j = 0 and, as a consequence, the actual degree of all gj is ` − 1. Hence, by using its expression in Proposition 2 we get that the degree of M3 is at most 3` − 5. Therefore, to obtain more isolated N -periodic sequences that by using M2 , the degree ` should be at least 5. Even for a fixed `, the construction of examples exhibiting the maximum number of isolated N -periodic sequences is tedious. We prefer do not give more details. 3.3. A 2-dimensional Abel type dynamical system. In this section we will see how the ideas introduced in the Section 3.1, together with Theorem 1 can be used to study the following 2-dimensional discrete dynamical system: xn xn+1 = , 1 + an xn + ε bn x2n + cn xn yn yn yn+1 = , 1 + dn yn + ε en xn yn + hn yn2 where rn = (xn , yn ), the 6 sequences are N -periodic and ε is a small parameter. Fol- lowing again the idea introduced in Section 2.1 we perform the change of variables rn = (xn , yn ) = Φ(sn ) = Φ(un , vn ) = (1/un , 1/vn ). By using it, the above system is transformed into   bn cn un+1 =un + an + ε + , un vn   en hn vn+1 =vn + dn + ε + . un vn When ε = 0, the sequences generated by it, with initial condition r0 = (u0 , v0 ) = (ρ, %), are n−1 X n−1 X (un , vn ) = (ρ + An , % + Dn ), where A0 = B0 = 0, An = aj , D n = dj . j=0 j=0 Hence they are N -periodic when AN = DN = 0. Moreover, in the notation of Theorem 1,   bn cn en hn gn (u, v) = + , + . u v u v 10 A. GASULL AND C. VALLS Therefore, the first discrete Melnikov function is N X −1   N X−1  ! bj cj ej hj M1 (ρ, %) = + , + j=0 ρ + Aj % + Dj j=0 ρ + A j % + Dj and it is defined in U, a neighborhood of infinity in R2 . Its simple zeroes give rise to N - periodic sequences defined by the 2-dimensional N -periodic discrete dynamical system. 3.4. Perturbations of autonomous globally periodic systems. When the unper- turbed system in (3) is N -globally periodic and autonomous, that is when all fn = f, the expressions Mj in Theorem 1 are simpler. If f 0 = Id and f k = f ◦ f k−1 , then f N = Id, rn = ϕn (ρ) = f n (ρ) and, for instance, N X −1 −1 M1 (ρ) = Dϕj (ρ) gj (ϕj (ρ)) j=0 N X −1 N X −1 −1 = Df j (ρ) gj (f j (ρ)) = Df N −j (f j (ρ))gj (f j (ρ)), (10) j=0 j=0 N N −j j because derivating f (ρ) = f (f (ρ)) = ρ we obtain that Df N −j (f j (ρ))Df j (ρ) = Id . Moreover, in the particular case that f is linear, that is f (r) = Ar where A is a d × d matrix such that AN = Id, we obtain that N X −1 M1 (ρ) = AN −j gj (Aj ρ), (11) j=0 and, similarly, N X −1  j−1 X  N −j j j−k k j M2 (ρ) = A Dgj (A ρ) A gk (A ρ) + hj (A ρ) , j=0 k=0 where the second sum, when j = 0 is defined as zero, because it corresponds to u0 (ρ) = 0. As an example, consider rn = (xn , yn ) defined by (xn+1 , yn+1 ) = (yn , −xn ) + ε(gn (xn , yn ), hn (xn , yn )) + O(ε2 ), with gn and hn , 4-periodic sequences of functions and r0 = (x0 , y0 ) = (ρ, %). We have that       0 1 2 −1 0 3 0 −1 A= , A = , A = and A4 = Id . −1 0 0 −1 1 0 Hence to find 4-periodic sequences generated to the discrete dynamical system we can study the zeroes of its first associated discrete Melnikov function. By using (11), some straightforward computations give that M1 (ρ, %) = g0 (ρ, %) − h1 (%, −ρ) − g2 (−ρ, −%) + h3 (−%, ρ),  h0 (ρ, %) + g1 (%, −ρ) − h2 (−ρ, −%) − g3 (−%, ρ) . DISCRETE MELNIKOV FUNCTIONS 11 3.5. Some applications to difference equations. Consider second order difference equations of the form xn+2 = Vn (xn , xn+1 ). As usual, they can be written as the discrete dynamical system (1) simply by taking rn = (xn , xn+1 ) and fn (x, y) = (y, Vn (x, y)). We will apply Theorem 1 to find isolated N -periodic sequences of second order diffe- rence equations of the form xn+2 = V (xn , xn+1 ) + εWn (xn , xn+1 ) + O(ε2 ), where xn+2 = V (xn , xn+1 ) is globally N -periodic in a suitable domain U ⊂ R2 and Wn is a N -periodic set of functions. By using the above reduction we can write the above difference equation as (3) where f (x, y) = (y, V (x, y)) and gn (x, y) = (0, Wn (x, y)). Several examples are given in Table 1, with their corresponding N, see for instance [1, 7]. In particular the case with period 5 corresponds to the celebrated Lyness difference equation. Notice that in the first four cases U = {(x, y) ∈ R2 : x > 0, y > 0}. N 4 6 5 3 4 6 1 y 1+y 1 xy + y 2 + p xy + p V (x, y) x x x xy x−y x−y Table 1. Examples of globally N -periodic difference equations. Here, p is a real parameter. As an illustration of the method we choose the simplest case, corresponding to N = 3. Then  1 1  f (x, y) = y, , f (f (x, y)) = , x , f (f (f (x, y))) = (x, y) xy xy and gn (x, y) = (0, Wn (x, y)). In order to obtain the expression of M1 given in (10) we need to calculate          1 0 0 −ρ/% −ρ2 % 0 0 1 0 + + , 0 1 g0 1 0 g1 −ρ%2 −%/ρ g2 where g0 = g0 (ρ, %), g1 = g1 (%, 1/(ρ%)), g2 = g2 (1/(ρ%), ρ) and with r0 = (x0 , x1 ) = (ρ, %). Hence   1 1   2 % 1  M1 (ρ, %) = − ρ %g1 %, + g2 , ρ , g0 (ρ, %) − g2 ,ρ . ρ% ρ% ρ ρ% Obviously, the same approach can be extended to study higher order difference equa- tions. For instance we could apply it to study the 8-periodic sequences of the 3rd order perturbed difference equation 1 + xn+1 + xn+2 xn+3 = + εWn (xn , xx+1 , xn+2 ) + O(ε2 ), xn taking rn = (xn , xx+1 , xn+2 ) because when ε = 0 it is a 8-periodic difference equation, called sometimes Todd difference equation. 12 A. GASULL AND C. VALLS Acknowledgments The first author is partially supported by the grants Ministerio de Ciencia, Inno- vación y Universidades of the Spanish Government through grant MTM2016-77278-P (MINECO/AEI/FEDER, UE) and 2017-SGR-1617 from AGAUR, Generalitat de Ca- talunya. The second author is partially supported by FCT/Portugal through grant UID/MAT/04459/2013. References [1] F. Balibrea, A. Linero-Bas, Some new results and open problems on periodicity of difference equa- tions, In Iteration theory (ECIT 04), 15–38, Grazer Math. Ber. 350, 2006. [2] W-J. Beyn, T. Hüls, M.C. Samtenschnieder, On r-periodic orbits of k-periodic maps, J. Difference Equations and Appl, 14 (2008), 865–887. [3] M. Bohner, A. Gasull, C. Valls, Periodic solutions of linear, Riccati, and Abel dynamic equations. J. Math. Anal. Appl., 470 (2019), 733–749. [4] M. Bohner, A. Peterson, Dynamic equations on time scales. An introduction with applications, Birkhäuser Boston, Inc., Boston, MA, 2001. [5] M. Bohner, A. Peterson, Advances in dynamic equations on time scales, Birkhäuser Boston, Inc., Boston, MA, 2003. [6] A. Cima, A. Gasull, V. Mañosa, Parrondo’s dynamic paradox for the stability of non-hyperbolic fixed points. Discrete Contin. Dyn. Syst., 38 (2018), 889–904. [7] A. Cima, A. Gasull, V. Mañosa, F. Mañosas, Different approaches to the global periodicity problem. In Discrete dynamical systems and applications (Proceedings of ICDEA2012), 85–106. Springer Proceedings in Mathematics & Statistics, Springer, Berlin, Heidelberg, 2016 [8] B. Coll, A. Gasull, R. Prohens, Bifurcation of limit cycles from two families of centers. Dyn. Contin. Discrete Impuls. Syst. Ser A: Math Anal., 12 (2005) 275–288. [9] B. Coll, A. Gasull, R. Prohens, Periodic orbits for perturbed non-autonomous differential equations. Bull. Sci. Math., 136 (2012), 803–819. [10] S. Elaydi, An introduction to difference equations, 2nd edition, Springer-Verlag, New York, 1999. [11] S. Elaydi, R.J. Sacker, Global stability of periodic orbits of non-autonomous difference equations and population biology, J. Differential Equations, 208 (2005), 258–273. [12] S. Elaydi, R.J. Sacker, Periodic difference equations, population biology and the Cushing-Henson conjectures, Math. Biosci., 201 (2006), 195–207. [13] J.E. Franke, J.F. Selgrade, Attractors for discrete periodic dynamical systems, J. Math. Anal. Appl., 286 (2003), 64–79. Pn [14] A. Lins Neto, On the number of solutions of the equation dx/dt = j=0 aj (t)xj , 0 ≤ t ≤ 1, for which x(0) = x(1), Invent. Math., 59, (1980), 67–76. [15] R.J. Sacker, H. von Bremen, A conjecture on the stability of periodic solutions of Ricker’s equation with periodic parameters, Appl. Math. Comp., 217 (2010), 1213–1219. [16] J.F. Selgrade, J.H. Roberds, On the structure of attractors for discrete, periodically forced systems with applications to population models, Physica D, 158 (2001), 69–82. [17] J.F. Selgrade, J.H. Roberds, Global attractors for a discrete selection model with periodic immi- gration, J. Difference Equations and Appl., 13 (2007), 275–287 Dep. de Matemàtiques, Universitat Autònoma de Barcelona, 08193 Bellaterra, Bar- celona, Spain E-mail address: gasull@mat.uab.cat Dep. de Matemática, Instituto Superior Técnico, Av. Rovisco Pais 1049-001, Lisboa, Portugal E-mail address: cvalls@math.ist.utl.pt