1 Introduction

Discrete equations attracted the interest of many scientists during the past decades for several reason, spanning from philosophical to practical. For instance, several modern theory of physics led to hypothesis that the nature of space-time itself at very small scales, the so-called Planck length and Planck time, is discrete. From this assumption, it follows that discrete systems are actually at the very foundation of physical sciences [24]. On the other hand, discrete systems often appear in applied sciences as tools to investigate numerically equations whose closed-form solution is not available. In particular, discrete equations are related to finite difference methods for solving ordinary and partial differential equations [37]. These considerations greatly stimulated the theoretical study of discrete systems from different points of view and perspective, see [10, 25].

In this paper, we will deal fourth-order difference equations, that is, functional equations for an unknown sequence \(\left\{ x_{n} \right\} \) where the \(x_{n+2}\) element is expressible in terms of the previous \(x_{n+i}\), \(i=-2,\ldots ,1\). That is a fourth-order difference equation is a relation of the form:

$$\begin{aligned} x_{n+2} = F\left( x_{n+1},x_{n},x_{n-1},x_{n-2} \right) . \end{aligned}$$
(1.1)

Such kind of functional equations are also called recurrence relations of order four. A fourth-order difference equation is called invertible if it is possible to solve Eq. (1.1) in a unique way with respect to \(x_{n-2}\).

$$\begin{aligned} x_{n-2} = \widetilde{F}\left( x_{n+2},x_{n+1},x_{n},x_{n-1} \right) . \end{aligned}$$
(1.2)

To be specific, using the solution of the inverse problem of calculus of variations we gave in [19], we will classify the variational additive fourth-order difference equations. We recall that a difference equation of order 2k

$$\begin{aligned} x_{n+k} = F\left( x_{n+k-1},x_{n+k-2},\ldots ,x_{n-k} \right) , k\ge 1, \end{aligned}$$
(1.3)

is said to be variational if there exists a discrete Lagrangian:

$$\begin{aligned} L_{n} = L_{n}\left( x_{n+k},x_{n+k-1},\ldots ,x_{n} \right) \end{aligned}$$
(1.4)

whose discrete Euler–Lagrange equation.

$$\begin{aligned} \sum _{l=0}^{k} \frac{\partial L_{n-l}}{\partial x_{n}}\left( x_{n+k-l},x_{n+k-1-l},\ldots ,x_{n-l} \right) = 0 \end{aligned}$$
(1.5)

coincide with Eq. (1.3). For a complete discussion on the variational formulation of difference equation, we refer to [2, 19, 28, 34, 40, 41]. In the same way, we recall that a fourth-order difference equation of the form:

$$\begin{aligned} x_{n+2} = f\left( x_{n+1},x_{n},x_{n-1} \right) x_{n-2}+h\left( x_{n+1},x_{n},x_{n-1} \right) , \end{aligned}$$
(1.6)

is said to be additive. Additive fourth-order difference equations are a natural generalisation of this class of difference equations:

$$\begin{aligned} x_{n+1} + x_{n-1} = f\left( x_{n} \right) , \end{aligned}$$
(1.7)

called the additive second-order difference equations. The class (1.7) is well-known since it includes very famous examples of integrable difference equations, like the McMillan equation [36] and the additive QRT maps [38, 39]. Equation (1.7) is variational with the following Lagrangian:

$$\begin{aligned} L = x_{n}x_{n+1} - \int ^{x_{n}} f\left( \xi \right) {{\,\mathrm{d}\,}}\xi . \end{aligned}$$
(1.8)

In the recent literature [21, 22, 29] appeared several examples of equations of the form (1.6). In particular, in [22], following [19], it was proved that not all the considered equations were variational, and that variational structure was intimately related to their integrability. This gives us the motivation to study the conditions on the variational structure of the general additive fourth-order difference equations.

Within this paper, we give a complete characterisation of the variational structure of the additive fourth-order difference equations. Moreover, we classify up to linear transformation an integrable subclass admitting an invariant multi-affine in \(x_{n+1}\) and \(x_{n-2}\). The latter gives a variational interpretation of the result of [22].

The plan of the paper is following: in Sect. 2, we present our main result characterising the variational fourth-order additive difference equations in Theorem 2. Then, we present an algorithmic test to find the Lagrangian of an additive fourth-order different equation derived from Theorem 2 and we discuss some examples. In Sect. 3, we present a subclass of variational equations depending on seven parameters possessing two invariants. We discuss how to split this general family to five canonical forms depending on three essential parameters each and prove their Liouville integrability using the Lagrangian structure. Our results are summarised in Theorem 4. Then in Sect. 4, we present the continuum limits of the Liouville integrable canonical equations, their Lagrangian and invariants (first integrals). Finally in Sect. 5, we give some conclusions and outlook.

2 Classification results

In this section, we state and prove our main result on the structure of additive variational fourth-order difference equations, and introduce an algorithmic procedure to test it. Finally, we present some examples of the application of such procedure.

Our main result, Theorem 2, follows from the following result giving us a necessary and sufficient condition for the existence of discrete Lagrangian in the case \(k=2\).

Theorem 1

(Gubbiotti [19]) Let us assume we are given an invertible fourth-order difference equation represented by a pair of equations of the form (1.1) and (1.2). Then such pair of equations is variational if and only if the following partial difference equations are satisfied:

$$\begin{aligned}&\qquad \frac{\partial }{\partial x_{n-2}} \left\{ \left( \frac{\partial F}{\partial x_{n-2}}\right) ^{-1}\mathbf {A}^{+} \left[ \frac{\partial L_{n-2}}{\partial x_{n}}\left( x_{n},x_{n-1},x_{n-2} \right) \right] \right\} =0,\end{aligned}$$
(2.1a)
$$\begin{aligned}&\frac{\partial }{\partial x_{n+2}} \left\{ \left( \frac{\partial {\widetilde{F}}}{\partial x_{n+2}}\right) ^{-1}\mathbf {A}^{-} \left[ \frac{\partial L_{n}}{\partial x_{n}}\left( x_{n+2},x_{n+1},x_{n} \right) \right] \right\} =0, \end{aligned}$$
(2.1b)

where:

$$\begin{aligned} \mathbf {A}^{+}&= \frac{\partial F}{\partial x_{n-2}}\frac{\partial }{\partial x_{n-1}}- \frac{\partial F}{\partial x_{n-1}}\frac{\partial }{\partial x_{n-2}},\end{aligned}$$
(2.2a)
$$\begin{aligned} \mathbf {A}^{-}&= \frac{\partial {\widetilde{F}}}{\partial x_{n+2}}\frac{\partial }{\partial x_{n+1}}- \frac{\partial {\widetilde{F}}}{\partial x_{n+1}}\frac{\partial }{\partial x_{n+2}}, \end{aligned}$$
(2.2b)

are two linear differential operators called forward annihilation operator and backward annihilation operator, respectively.

Remark 1

The forward annihilation operator (2.2a) has this name because for every functions of the form

$$\begin{aligned} G=G\left( F\left( x_{n+1},x_{n},x_{n-1},x_{n-2} \right) ,x_{n+1},x_{n} \right) . \end{aligned}$$
(2.3)

we have \(\mathbf {A}^{+}\left( G \right) \equiv 0\). In the same way, the backward annihilation operator (2.2b) has this name because for every functions of the form

$$\begin{aligned} {\widetilde{G}}= {\widetilde{G}}\left( x_{n} ,x_{n-1},\widetilde{F}\left( x_{n+2},x_{n+1},x_{n},x_{n-1} \right) \right) . \end{aligned}$$
(2.4)

we have \(\mathbf {A}^{-}\left( G \right) \equiv 0\). All the other differential operators with such properties are multiples of \(\mathbf {A}^{\pm }\). Moreover, the annihilation operators are the one-dimensional analog of the differential operators used in the theory of generalised symmetries and Darboux integrability of quad-equations, see [14, 15, 15, 16, 23, 33].

2.1 General results

The variational structure of fourth-order difference equations is completely characterised by the following result:

Theorem 2

Equation (1.6) is variational if and only it has the following form:

$$\begin{aligned}&g\left( x_{n+1} \right) x_{n+2} + \lambda ^{2}g\left( x_{n-1} \right) x_{n-2}+ \lambda g'\left( x_{n} \right) x_{n+1}x_{n-1}\nonumber \\&\quad +\frac{\partial V}{\partial x_{n}}\left( x_{n+1},x_{n} \right) +\lambda \frac{\partial V}{\partial x_{n}}\left( x_{n},x_{n-1} \right) =0, \end{aligned}$$
(2.5)

that is:

$$\begin{aligned} f\left( x_{n+1},x_{n},x_{n-1} \right)&=-\lambda ^{2}\frac{g\left( x_{n-1} \right) }{g\left( x_{n+1} \right) } \end{aligned}$$
(2.6a)
$$\begin{aligned} g\left( x_{n+1} \right) h\left( x_{n+1},x_{n},x_{n-1} \right)&= -\lambda g'\left( x_{n} \right) x_{n+1}x_{n-1} -\frac{\partial V}{\partial x_{n}}\left( x_{n+1},x_{n} \right) \nonumber \\&\qquad -\lambda \frac{\partial V}{\partial x_{n}}\left( x_{n},x_{n-1} \right) =0. \end{aligned}$$
(2.6b)

In such case, the Lagrangian, up to total difference and multiplication by a constant, is given by:

$$\begin{aligned} L_{n} =\lambda ^{-n}\left[ g\left( x_{n+1} \right) x_{n}x_{n+2} + V\left( x_{n+1},x_{n} \right) \right] . \end{aligned}$$
(2.7)

The “only if” part of Theorem 2 is trivial. To prove the “if” part we use Theorem 1. Indeed, since Eq. (1.6) is trivially invertible:

$$\begin{aligned} x_{n-2} = \frac{ x_{n+2}-h\left( x_{n+1},x_{n},x_{n-1} \right) }{ f\left( x_{n+1},x_{n},x_{n-1} \right) } \end{aligned}$$
(2.8)

from Theorem 1 we have that a Lagrangian for (1.6) and its inverse (2.8) must satisfy Eqs. (2.2a) and (2.2b). That is:

$$\begin{aligned}&{\frac{\partial f}{\partial x_{{n-1}}}} \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) {\frac{\partial ^{2}L_{{n-2}}}{\partial x_{{n-2}}\partial x_{{n}}}} \left( x_{{n}},x_{{n-1}},x_{{n-2}} \right) -f \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) \nonumber \\&\times {\frac{\partial ^{3}L_{{n-2}}}{\partial x_{{n-1}}\partial x_{{n-2}}\partial x_{{n}}}} \left( x_{{n}},x_{{n-1}},x_{{n-2}} \right) \nonumber \\&+ \left[ {\frac{\partial f}{\partial x_{{n-1}}}} \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) x_{{n-2}} +{\frac{\partial h}{\partial x_{{n-1}}}} \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) \right] \nonumber \\&\times {\frac{\partial ^{3} L_{{n-2}}}{\partial x_{{n-2}}^{2}\partial x_{{n}}}} \left( x_{{n}},x_{{n-1}},x_{{n-2}}\right) =0,\end{aligned}$$
(2.9a)
$$\begin{aligned}&\left[ \left( x_{{n+2}}-f \left( x_{{n+1}},x_{{n}},x_{{n-1}}\right) \right) {\frac{\partial f}{\partial x_{{n+1}}}} \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) \right. \nonumber \\&\left. +f \left( x_{{n+1}},x_{{n}},x_{{n-1}}\right) {\frac{\partial h}{\partial x_{{n+1}}}} \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) \right] {\frac{\partial ^{3}L_{{n}}}{\partial x_{{n+2}}^{2}\partial x_{{n}}}} \left( x_{{n+2}},x_{{n+1}},x_{{n}}\right) \nonumber \\&+ \left( {\frac{\partial ^{3}L_{{n}}}{\partial x_{{n+2}}\partial x_{{n+1}} \partial x_{{n}}}} \left( x_{{n+2}},x_{{n+1}},x_{{n}} \right) \right) f \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) \nonumber \\&+ {\frac{\partial f}{\partial x_{{n+1}}}} \left( x_{{n+1}},x_{{n}},x_{{n-1}} \right) {\frac{\partial ^{2} L_{n}}{\partial x_{{n+2}}\partial x_{{n}}}} \left( x_{{n+2}},x_{{n+1}},x_{{n}} \right) =0. \end{aligned}$$
(2.9b)

Equation (2.9) is a functional differential equations where there are three different unknowns, f, h and \(L_{n}\) depending on various points of the \(\mathbb {Z}\) lattice. These points are independent, so they are different variables. A way to solve such functional differential equation is to convert it to a standard partial differential equation. For instance, consider Eq. (2.9a). We have that f and h depend on \(x_{n+1},x_{n},x_{n-1}\) while \(L_{n-2}=L_{n-2}\left( x_{n},x_{n-1},x_{n-2} \right) \). We can eliminate \(L_{n-2}\) solving with respect to its derivatives and then differentiating with respect to \(x_{n+1}\). To completely eliminate it, we need to repeat this process three times, one for derivative appearing in (2.9a). The intermediate derivative steps can be used as compatibility conditions.

So, the proof of the if part follows the application of the above reasoning until Eq. (2.9) are identically satisfied. Then, the Euler–Lagrange equations are used as final compatibility conditions. This shows that the form of the functions f, h, and \(L_{n}\) is given by formulas (2) and (2.7), respectively. The details of the proof are rather cumbersome, so for sake of exposition the interested reader will find them in Appendix A.

An immediate corollary of Theorem 2 is the following:

Corollary 1

Equation (1.6) admits an autonomous Lagrangian if and only it has the following form:

$$\begin{aligned}&g\left( x_{n+1} \right) x_{n+2} + g\left( x_{n-1} \right) x_{n-2}+ g'\left( x_{n} \right) x_{n+1}x_{n-1}\nonumber \\&\quad +\frac{\partial V}{\partial x_{n}}\left( x_{n+1},x_{n} \right) +\frac{\partial V}{\partial x_{n}}\left( x_{n},x_{n-1} \right) =0. \end{aligned}$$
(2.10)

In such case, the Lagrangian, up to total difference and multiplication by a constant, is given by:

$$\begin{aligned} L = g\left( x_{n+1} \right) x_{n}x_{n+2} + V\left( x_{n+1},x_{n} \right) . \end{aligned}$$
(2.11)

Proof

Trivially follows from Theorem 2 substituting \(\lambda =1\) in formulae (2.5) and (2.7). \(\square \)

Corollary 1 will be used in Sect. 3 while discussing the integrability properties of a subclass of variational additive fourth-order difference equations with autonomous Lagrangian.

We note that additive difference equation and their discrete Lagrangians are form invariant under the action of linear transformations, which is the content of the following lemma:

Lemma 1

Equation (1.6) is form invariant under linear point transformation

$$\begin{aligned} x_{n} = a X_{n} + b. \end{aligned}$$
(2.12)

That is an additive difference equation under the transformation (2.12) is transformed into another additive difference equation with transformed functions:

$$\begin{aligned} {\widetilde{f}}\left( X_{n+1},X_{n},X_{n-1} \right)&= f \left( a X_{n+1} +b,aX_{n}+b,aX_{n-1}+b\right) ,\end{aligned}$$
(2.13a)
$$\begin{aligned} {\widetilde{h}}\left( X_{n+1},X_{n},X_{n-1} \right)&= \frac{b}{a}\left[ \widetilde{f}(X_{n+1}, X_{n}, X_{n-1})-1\right] +\frac{1}{a}h(a X_{n+1}+b,\nonumber \\&a X_{n}+b, a X_{n-1}+b). \end{aligned}$$
(2.13b)

Moreover, the Lagrangian (2.7) is also form invariant under the linear point transformation (2.12) with transformed functions:

$$\begin{aligned} g\left( X_{n} \right)&= a^{2} g\left( aX_{n+1}+b \right) ,\end{aligned}$$
(2.14a)
$$\begin{aligned} V\left( X_{n+1},X_{n} \right)&= a b \left[ g\left( aX_{n+1}+b \right) X_{n} +\lambda g\left( aX_{n}+b \right) X_{n+1}\right] \nonumber \\&\quad +b^{2} g\left( aX_{n+1}+b \right) +V\left( aX_{n+1}+b,aX_{n}+b \right) . \end{aligned}$$
(2.14b)

Proof

Trivially follows by applying the transformation (2.12) to Eq. (1.6) and the discrete Lagrangian (2.7). \(\square \)

Remark 2

The property of form invariance tells us that the classification result of Theorem 2 is preserved up to linear transformations. Moreover, form invariance will be used in Sect. 3 when enumerating the possible forms of integrable additive fourth-order difference equations.

Theorem 2 gives also a practical test to establish whether or not a given additive fourth-order Eq. (1.6) is variational without having to apply the full algorithm of [19]. That is, given an additive fourth-order difference equation the test runs as follows:

  1. 1.

    Write the equation clearing the denominators:

    $$\begin{aligned} A\left( x_{n+1},x_{n},x_{n-1} \right) x_{n+2}+ B\left( x_{n+1},x_{n},x_{n-1} \right) x_{n-2} +C\left( x_{n+1},x_{n},x_{n-1} \right) =0. \end{aligned}$$
    (2.15)
  2. 2.

    In order to be in the form (2.5), the functions A and B need to be of the following form:

    $$\begin{aligned} A\left( x_{n+1},x_{n},x_{n-1} \right) = K\left( x_{n} \right) g\left( x_{n+1} \right) , \quad B\left( x_{n+1},x_{n},x_{n-1} \right) = \lambda ^{2} K\left( x_{n} \right) g\left( x_{n-1} \right) , \end{aligned}$$
    (2.16)

    for some function \(K=K\left( \eta \right) \) and \(g=g\left( \xi \right) \) and constant \(\lambda \).

  3. 3.

    Using Eq. (2.16), we divide Eq. (2.15) by \(K=K\left( x_{n} \right) \) and using the definition of g we rewrite Eq. (2.15) as:

    $$\begin{aligned} g\left( x_{n+1}\right) x_{n+2} + \lambda ^{2} g\left( x_{n-1} \right) x_{n-2} +\lambda g'\left( x_{n} \right) x_{n+1}x_{n-1} +R\left( x_{n+1},x_{n},x_{n-1} \right) =0. \end{aligned}$$
    (2.17)

    with a new function \(R=R\left( \xi ,\eta ,\zeta \right) \).Footnote 1

  4. 4.

    To be in the form (2.5), we need to check that:

    $$\begin{aligned} \frac{\partial R}{\partial x_{n+1},x_{n-1}}\left( x_{n+1},x_{n},x_{n-1} \right) \equiv 0. \end{aligned}$$
    (2.18)
  5. 5.

    If the function R in Eq. (2.17) satisfies condition (2.18), it implies that we can write:

    $$\begin{aligned}&g\left( x_{n+1}\right) x_{n+2}+\lambda ^{2} g\left( x_{n-1} \right) x_{n-2} +\lambda g'\left( x_{n} \right) x_{n+1}x_{n-1} +M\left( x_{n+1},x_{n} \right) \nonumber \\&\quad +N\left( x_{n},x_{n-1} \right) =0. \end{aligned}$$
    (2.19)
  6. 6.

    Comparing again with Eq. (2.5), we have that the two functions \(M=M\left( \xi ,\eta \right) \) and \(N=N\left( \xi ,\eta \right) \) need to satisfy the following closure relation:

    $$\begin{aligned} \lambda \frac{\partial M}{\partial \xi }\left( \xi ,\eta \right) = \frac{\partial N}{\partial \eta }\left( \xi ,\eta \right) . \end{aligned}$$
    (2.20)
  7. 7.

    If the closure relation (2.20) is satisfied, then Eq. (2.15) is in the form (2.5); therefore, it is variational. The function V can be computed using from the following integral:

    $$\begin{aligned} V\left( x_{n+1},x_{n} \right) = \int _{\Gamma } M\left( x_{n+1},x_{n} \right) {{\,\mathrm{d}\,}}x_{n} + \lambda ^{-1} N\left( x_{n+1},x_{n} \right) {{\,\mathrm{d}\,}}x_{n+1}, \end{aligned}$$
    (2.21)

    on a properly chosen path \(\Gamma \subset \mathbb {R}^{2}\).

Remark 3

In the above discussion, we tacitly assumed that the functions \(M=M\left( \xi ,\eta \right) \) and \(N=N\left( \xi ,\eta \right) \) were defined on some simply-connected domain \(D\subset \mathbb {R}^{2}\), e.g. a star-shaped domain. In practice, we need to check this assumption in order to carry out the last step of this test. If this hypothesis is not satisfied we cannot use formula (2.21), but we need to directly solve the overdetermined system of partial differential equations:

$$\begin{aligned} \frac{\partial V}{\partial x_{n}}=M(x_{n+1},x_{n}), \quad \lambda \frac{\partial V}{\partial x_{n+1}}=N(x_{n+1},x_{n}). \end{aligned}$$
(2.22)

A simple example of this occurrence is given by the following additive fourth-order difference equation:

$$\begin{aligned} x_{n+1} x_{n+2}+x_{n-1} x_{n+1}+ x_{n-1} x_{n-2} -\frac{x_{n+1}}{x_{n}^2+x_{n+1}^2}+\frac{x_{n-1}}{x_{n}^2+x_{n-1}^2}=0. \end{aligned}$$
(2.23)

In this case, it is easy to see, as the denominator are already cleared, that \(g\left( \xi \right) =\xi \), \(\lambda ^{2}=1\) and:

$$\begin{aligned} R\left( x_{n+1},x_{n},x_{n-1} \right) = -\frac{x_{n+1}}{x_{n}^2+x_{n+1}^2}+\frac{x_{n-1}}{x_{n}^2+x_{n-1}^2}. \end{aligned}$$
(2.24)

The condition (2.18) is satisfied, and we are left with:

$$\begin{aligned} M\left( \xi ,\eta \right) =-\frac{\xi }{\xi ^{2}+\eta ^2}, \quad N\left( \xi ,\eta \right) =\frac{\eta }{\xi ^{2}+\eta ^2}. \end{aligned}$$
(2.25)

The closure condition gives \(\lambda =1\). However, since the functions M and N are defined in the multiply-connected domain \(D=\mathbb {R}^{2}\setminus \left\{ 0 \right\} \), it is not enough. Indeed, it is known that it is not possible to construct the function V using formula (2.21) as the line integral depends on the path [9]. However, the function

$$\begin{aligned} V\left( x_{n+1},x_{n} \right) = \arctan \left( \frac{x_{n+1}}{x_{n}} \right) , \end{aligned}$$
(2.26)

satisfies Eq. (2.22). Therefore, Eq. (2.23) is variational with the following Lagrangian:

$$\begin{aligned} L= x_{n}x_{n+1}x_{n+2}+ \arctan \left( \frac{x_{n+1}}{x_{n}} \right) . \end{aligned}$$
(2.27)

2.2 Examples

We now discuss three explicit examples of the usage of the test we presented. In particular, in Examples 2 and 3 we show how the test derived from Theorem 2 can be used to filter out Lagrangian examples out of parametric families of equations.

Example 1

Consider the following fourth-order difference equation:

$$\begin{aligned} \frac{x_{n+2}}{x_{n-1}^3}+\frac{x_{n-2}}{x_{n+1}^3} +\frac{1}{x_{n-1}^2 x_{n+1}^2}\left[ 3 x_{n}^2-\frac{\mu }{(x_{n}^2-1) x_{n-1} x_{n+1}} \right] =0. \end{aligned}$$
(2.28)

Taking the numerator, we find:

$$\begin{aligned} A = (x_{n}^2-1) x_{n+1}^{3},\quad B = (x_{n}^2-1) x_{n-1}^{3} \end{aligned}$$
(2.29)

therefore \(K=x_{n}^2-1\), \(g=\xi ^{3}\) and \(\lambda ^{2}=1\). With this definition, we can rewrite Eq. (2.28) as:

$$\begin{aligned} x_{n+1}^3x_{n+2}+x_{n-1}^3x_{n-2} + 3 \lambda x_{n}^{2} x_{n+1} x_{n-1} =R\left( x_{n+1},x_{n},x_{n-1} \right) , \end{aligned}$$
(2.30)

with:

$$\begin{aligned} R \left( x_{n+1},x_{n},x_{n-1} \right) = -\frac{\mu }{x_n^2-1}-3 x_{n-1} x_{n+1} (\lambda -1) x_{n}^2. \end{aligned}$$
(2.31)

The compatibility condition (2.18) gives \(\lambda =1\), and implies:

$$\begin{aligned} M\left( \xi ,\eta \right) = -\frac{1}{2}\frac{\mu }{\eta ^2-1}, \quad N\left( \xi ,\eta \right) = -\frac{1}{2}\frac{\mu }{\xi ^2-1}. \end{aligned}$$
(2.32)

We can think of the functions M and N as defined on the star-shaped domain \(D = \left( -1,1 \right) \times \left( -1,1 \right) \) and compute the function V with formula (2.21):

$$\begin{aligned} V\left( x_{n+1},x_{n} \right) = \frac{\mu }{2}\left[ {{\,\mathrm{arctanh}\,}}\left( x_{n} \right) +{{\,\mathrm{arctanh}\,}}\left( x_{n+1} \right) \right] . \end{aligned}$$
(2.33)

Then, the Lagrangian for Eq. (2.28) is given by:

$$\begin{aligned} L= x_{n+1}^{3} x_{n} x_{n+2}+ \frac{\mu }{2}\left[ {{\,\mathrm{arctanh}\,}}\left( x_{n} \right) +{{\,\mathrm{arctanh}\,}}\left( x_{n+1} \right) \right] . \end{aligned}$$
(2.34)

Example 2

Consider the family of fourth-order difference equations:

$$\begin{aligned} x_{n-1}^2 x_{n-2}+x_{n+1}^2 x_{n+2} +\frac{1}{1-x_{n}}+x_{n} (a_{02} x_{n-1}^2+a_{11} x_{n-1} x_{n+1}+a_{20} x_{n+1}^2)=0, \end{aligned}$$
(2.35)

depending parametrically on the three parameters \(a_{ij}\), \(i+j=2\). We will find the value of the parameters such that Eq. (2.35) is variational.

First of all, we notice that Eq. (2.35) has already the numerators cleared and that \(A=x_{n+1}^{2}\), \(B=x_{n-1}^{2}\). It follows that \(K=1\), \(g=\xi ^{2}\) and \(\lambda ^{2}=1\). We can then write down Eq. (2.35) as:

$$\begin{aligned} x_{n-1}^2 x_{n-2}+x_{n+1}^2 x_{n+2}+2\lambda x_{n}x_{n+1}x_{n-1}+ R\left( x_{n+1},x_{n},x_{n-1} \right) =0, \end{aligned}$$
(2.36)

where the function R is given by:

$$\begin{aligned} R = \frac{1}{1-x_{n}}+x_{n} \left[ a_{02} x_{n-1}^2+\left( a_{11}-2\lambda \right) x_{n-1} x_{n+1}+a_{20} x_{n+1}^2\right] , \end{aligned}$$
(2.37)

Imposing the compatibility condition (2.18), we obtain \(a_{11} = 2\lambda \). Using this definition, we have the following expressions for the functions M and N:

$$\begin{aligned} M\left( \xi ,\eta \right) = \frac{1}{2}\frac{1}{1-\eta }+a_{20}\eta \xi ^2, \quad N\left( \xi ,\eta \right) = \frac{1}{2}\frac{1}{1-\xi }+a_{02}\xi \eta ^2. \end{aligned}$$
(2.38)

The closure relation (2.20) is then:

$$\begin{aligned} \lambda \frac{\partial M}{\partial \xi }\left( \xi ,\eta \right) - \frac{\partial N}{\partial \eta }\left( \xi ,\eta \right) =2\xi \eta \left( \lambda a_{20}-a_{02} \right) \equiv 0. \end{aligned}$$
(2.39)

This implies that Eq. (2.35) with \(a_{11}=2\lambda \) is not variational unless \(a_{02}=\lambda a_{20}=\lambda \mu \). As M and N are defined on the star-shaped domain \(D=(1,\infty )\times (1,\infty )\), we obtain:

$$\begin{aligned} V (x_{n+1},x_{n}) = \frac{1}{2} \left[ \mu x_{n+1}^2 x_{n}^2-\log (x_{n}-1)-\frac{1}{\lambda }\log (x_{n+1}-1) \right] . \end{aligned}$$
(2.40)

Finally, we obtained that the one-parameter family of additive fourth-order difference equations:

$$\begin{aligned}&x_{n-1}^2 x_{n-2}+x_{n+1}^2 x_{n+2} +\frac{1}{1-x_{n}} +x_{n} \left[ \mu \left( \lambda x_{n-1}^2+x_{n+1}^2\right) +2 \lambda x_{n-1} x_{n+1}\right] =0,\nonumber \\&\lambda ^{2}=1, \end{aligned}$$
(2.41)

can be derived by the following Lagrangian:

$$\begin{aligned} L_{n}&= \lambda ^{-n}\left\{ x_{n+1}^{2}x_{n}x_{n+2} \frac{1}{2} \left[ \mu x_{n+1}^2 x_{n}^2-\log (x_{n}-1)-\frac{1}{\lambda }\log (x_{n+1}-1) \right] \right\} ,\nonumber \\&\lambda ^{2}=1. \end{aligned}$$
(2.42)

Example 3

In this example, we classify the most general variational fourth-order linear difference equation:

$$\begin{aligned} x_{n+2} + c_{1} x_{n+1} + c_{0} x_{n} + c_{-1} x_{n-1} + c_{-2} x_{n-2} +b =0. \end{aligned}$$
(2.43)

We normalised the equation with respect to the coefficient of \(x_{n+2}\), which must be different from zero. Then we notice that also \(c_{-2}\ne 0\) in order to have a proper fourth-order equation.

First, we notice that Eq. (2.43) is denominator free. Then \(A=1\), \(B=c_{-2}\). Therefore, it follows that \(K=1\), \(g=1\) and \(\lambda ^{2}=c_{-2}\). We can then write down Eq. (2.43) as:

$$\begin{aligned} x_{n+2}+c_{-2} x_{n-2}+ R\left( x_{n+1},x_{n},x_{n-1} \right) =0, \end{aligned}$$
(2.44)

where the function R is given by:

$$\begin{aligned} R = c_{-1} x_{n-1}+c_{0} x_{n}+c_{1} x_{n+1}+b. \end{aligned}$$
(2.45)

The compatibility condition (2.18) is identically satisfied. Using this definition, we have the following expressions for the functions M and N:

$$\begin{aligned} M\left( \xi ,\eta \right) = c_{1} \xi +\frac{c_{0}}{2} \eta +\frac{b}{2} , \quad N\left( \xi ,\eta \right) = c_{-1} \eta + \frac{c_{0}}{2} \xi +\frac{b}{2}. \end{aligned}$$
(2.46)

The closure relation (2.20) is then:

$$\begin{aligned} c_{-2}^{1/2}\frac{\partial M}{\partial \xi }\left( \xi ,\eta \right) - \frac{\partial N}{\partial \eta }\left( \xi ,\eta \right) =c_{-2}^{1/2}c_{1}-c_{-1}\equiv 0. \end{aligned}$$
(2.47)

This implies that Eq. (2.43) is variational if and only if \(c_{-2}=\left( c_{-1}/c_{1}\right) ^{2}\). As M and N are defined on the whole \(\mathbb {R}^{2}\) we obtain:

$$\begin{aligned} V (x_{n+1},x_{n}) =\frac{c_{0}}{4}\left( {\frac{c_{{1}}x_{{n+1}}^{2}}{c_{{-1}}}}+x_{{n}}^{2} \right) +\frac{b}{2} \left( x_{{n}}+ {\frac{c_{{1}}x_{{n+1}}}{c_{{-1}}}} \right) +c_{{1}}x_{{n}}x_{{n+1}} \end{aligned}$$
(2.48)

We obtained that the most general linear variational fourth-order difference equation has the following from:

$$\begin{aligned} x_{n+2} + c_{1} x_{n+1} + c_{0} x_{n} + c_{-1} x_{n-1} + \left( \frac{c_{-1}}{c_{1}}\right) ^{2}x_{n-2} +b =0. \end{aligned}$$
(2.49)

and the following Lagrangian:

$$\begin{aligned} L_{n}&= \left( \frac{c_{1}}{c_{-1}}\right) ^{n} \left[ x_{n}x_{n+2}+ \frac{c_{0}}{4}\left( {\frac{c_{{1}}x_{{n+1}}^{2}}{c_{{-1}}}}+x_{{n}}^{2} \right) +\frac{b}{2} \left( x_{{n}}+ {\frac{c_{{1}}x_{{n+1}}}{c_{{-1}}}} \right) +c_{{1}}x_{{n}}x_{{n+1}} \right] . \end{aligned}$$
(2.50)

Notice that the above Lagrangian becomes independent of n if and only if \(c_{1}=c_{-1}\).

3 Integrability results

In this section, we address to the problem of finding some Liouville integrable examples out of the general family of additive fourth-order equations possessing an autonomous Lagrangian, as characterised by Corollary 1.

We recall that a difference equation of order 2k is said to be Liouville integrable if it possesses k invariants and preserves a Poisson structure of order k [2, 6, 35, 41]. Variational difference equations preserve a rank k Poisson structure built with the discrete Ostrogradsky transformation, see [2, 40].

We search for Liouville integrable cases of fourth-order additive difference equations with autonomous Lagrangian since Liouville integrability is defined for autonomous symplectic structures with autonomous invariants. We make an ansatz on the form of the invariant which will allow us to compare our results with the recent paper [22]. In particular, we will show that within the Lagrangian framework we are able to produce integrable equations imposing only one invariant, as the second one will be admitted naturally by equation. Finally, we divide the integrable cases in five form invariant canonical forms, in the sense of Lemma 1.

3.1 Additive equations with an invariant multi-affine in \(x_{n+1}\) and \(x_{n-2}\)

In [22] were classified fourth-order difference equations using the following assumptions:

  1. A.

    The equation possesses two symmetric polynomial invariant that is, two invariants \(I= I\left( x_{n+1},x_{n},x_{n-1},x_{n-2} \right) \), which are polynomial functions and such that:

    $$\begin{aligned} I\left( x_{n-2},x_{n-1},x_{n},x_{n+1} \right) = I\left( x_{n+1},x_{n},x_{n-1},x_{n-2} \right) . \end{aligned}$$
    (3.1)
  2. B.

    One invariant, called \(I_\text {low}\), is such that:

    $$\begin{aligned} \deg _{x_{n+1}} I_\text {low} =\deg _{x_{n-2}} I_\text {low} = 1, \quad \deg _{x_{n}} I_\text {low} =\deg _{x_{n-1}} I_\text {low} = 3, \end{aligned}$$
    (3.2)

    and its coefficients interpolates the form of the lowest-order invariant of the autonomous \(\mathrm {d}P_\text {I}^{(2)}\) and \(\mathrm {d}P_\text {II}^{(2)}\) equations (see [22, 29] for details).

  3. C.

    One invariant, called \(I_\text {high}\), is such that:

    $$\begin{aligned} \deg _{x_{n+1}} I_\text {high} =\deg _{x_{n-2}} I_\text {high} = 2, \quad \deg _{x_{n}} I_\text {high} =\deg _{x_{n-1}} I_\text {high} = 4. \end{aligned}$$
    (3.3)

Remark 4

The invariant \(I_\text {low}\) is affine in the variables \(x_{n+1}\) and \(x_{n-2}\). So, it is called a multi-affine function with respect to the variables \(x_{n+1}\) and \(x_{n-2}\).

Within this framework, six different equations were derived. Some were integrable, some were non-integrable according the algebraic entropy criterion [1, 11, 42]. It was proved, following [19], that the integrable cases were either variational or admitted one additional invariant, being then integrable in the naïve sense [20]. So, variational structures were the key feature in understanding the integrability of these examples.

Now we will discuss the Liouville integrability of variational fourth-order equations. Our final result is stated at the end of this section in Theorem 4. This result unifies the result obtained in [22] and shows the power of the variational approach. Our starting point is the existence of a single invariant multi-affine with respect to the variables \(x_{n+1}\) and \(x_{n-2}\), characterised by the following theorem:

Theorem 3

Equation (2.5) admits a multi-affine invariant with respect to the variables \(x_{n+1}\) and \(x_{n-2}\) of the following form:

$$\begin{aligned} I\left( x_{n+1},x_{n},x_{n-1} ,x_{n-2} \right)&= x_{n+1} P_{1}\left( x_{n},x_{n-1} \right) +x_{n-2} P_{2}\left( x_{n},x_{n-1} \right) \nonumber \\&\qquad + x_{n+1}x_{n-2} P_{3}\left( x_{n},x_{n-1} \right) + P_{4}\left( x_{n},x_{n-1} \right) , \end{aligned}$$
(3.4)

where \(P_{i}=P_{i}\left( x_{n},x_{n-1} \right) \) are a priori arbitrary functions if and only if the following conditions hold true:

  • The function \(g=g\left( \xi \right) \) is a second-order polynomial in its variable:

    $$\begin{aligned} g\left( \xi \right) = A_{1} \xi ^{2}+A_{2}\xi +A_{3}. \end{aligned}$$
    (3.5)
  • The function \(V=V\left( \xi ,\eta \right) \) has the following form:

    $$\begin{aligned} V = W(\eta )+\frac{A_{1}}{2} \xi ^2 \eta ^2 +A_2 \xi ^2 \eta +A_2 \xi \eta ^2+A_7 \xi \eta , \end{aligned}$$
    (3.6)

    where the function \(W=W\left( \eta \right) \) is given by integrating:

    $$\begin{aligned} W'\left( \eta \right) = \frac{A_2^2 \eta ^3+A_2 A_3 \eta ^2+A_2 A_7 \eta ^2+A_2 A_8 \eta +A_3^2 \eta +A_3 A_8+A_6 \eta +A_5}{A_1 \eta ^2+A_2 \eta +A_3}, \end{aligned}$$
    (3.7)

    with initial condition \(W\left( 0 \right) =0\).

  • The functions \(P_{i}=P_{i}\left( x_{n},x_{n-1} \right) \) are degree three polynomials.

The Proof of Theorem 3 is mainly computational using the explicit form of the invariant (3.4) and of Eq. (2.5). Overall, it follows the same lines of the proof of Theorem 2, and the interested reader can find it in Appendix B.

The explicit expression of the variational additive difference equations with one integral of the form (3.4) is given by:

$$\begin{aligned}&(A_{1} x_{n-1}^2+A_{2} x_{n-1}+A_{3}) x_{n-2} +(A_{1} x_{n+1}^2+A_{2} x_{n+1}+A_{3}) x_{n+2}\nonumber \\&\quad +(A_{1} x_{n}+A_{2}) \left( x_{n+1}^2+x_{n-1}^2\right) +(2 A_{1} x_{n}+A_{2}) x_{n-1} x_{n+1} {+}(2 A_{2} x_{n}{+}A_{7}) \left( x_{n+1} + x_{n-1}\right) \nonumber \\&\quad +\frac{A_{2}^2 x_{n}^3+\left( A_{2} A_{3} +A_{2} A_{7}\right) x_{n}^2 +\left( A_{2} A_{8} +A_{3}^2 +A_{3} A_{8}+A_{6}\right) x_{n}+A_{5}}{A_{1} x_{n}^2+A_{2} x_{n}+A_{3}}=0. \end{aligned}$$
(3.8)

We choose to not present the explicit form of the Lagrangian for Eq. (3.8) yet, since it depends on the functional form of the solution of Eq. (3.7). Such solution is different depending on the values of the parameters \(A_{i}\), and it is impossible to write down in full generality. We will present the explicit Lagrangians later when we will discuss the canonical forms of Eq. (3.8).

By direct inspection, it is possible to prove that Eq. (3.8) possess a second invariant of higher degree. We don’t present its form for general values of the parameters \(A_{i}\) as it is quite cumbersome. However, we note that such invariant is functionally independent from (3.4). So, Eq. (3.8) is candidate to be an integrable equation, as it possesses two independent invariants and it is variational by construction. We defer this part of the proof to Sect. 3.2, where using the invariance with respect to linear transformations we can provide simple formulas for the invariants and the associated Poisson structures.

3.2 Canonical forms

Consider Eq. (3.8). This equation depends on a polynomial \(g\left( \xi \right) \) (3.5), which in the general case has degree two. Depending on the values of the coefficients \(A_{1}\), \(A_{2}\) and \(A_{3}\), assumed to be real, the polynomial \(g\left( \xi \right) \) (3.5) can be of the following five forms:

  1. Case 1

    \(\deg g = 2\) and it has two real independent solutions \(x_{1}\) and \(x_{2}\).

  2. Case 2

    \(\deg g = 2\) and it has one solutions \(x_{0}\) of multiplicity two.

  3. Case 3

    \(\deg g = 2\) and it has two complex conjugate solutions \(x_{0}\) and \(x_{0}^{*}\).

  4. Case 4

    \(\deg g = 1\).

  5. Case 5

    \(\deg g = 0\).

We will now consider explicitly these five possibility and show, using the form invariance with respect to linear transformations (2.12) that they give raise to five different canonical forms of Eq. (3.8). That is, an equation of the form (3.8) for a specific choice of the parameters reduces to one of these five using the appropriate linear transformation and reparametrisation. Finally, these canonical forms show the true number of independent parameters and will be helpful to compute the continuum limits in Sect. 4.

Case 1 If \(\deg g = 2\) and it has two real independent solutions \(\xi =x_{1},x_{2}\), these solutions can be rescaled to \(\pm 1\) through the transformation:

$$\begin{aligned} x_{n} = \frac{x_{2}-x_{1}}{2} X_{n} + \frac{x_{1}+x_{2}}{2}. \end{aligned}$$
(3.9)

So, in case 1 Eq. (3.8) reduces to the first canonical form:

$$\begin{aligned}&(X_{n+1}^{2}-1) X_{n+2} + (X_{n-1}^{2}-1) X_{n-2} +X_{n} \left( X_{n+1}+X_{n-1} \right) ^{2} +\gamma \left( X_{n+1}+X_{n-1}\right) \nonumber \\&\quad + \frac{\alpha X_{n}+\beta }{X_{n}^{2}-1}=0. \end{aligned}$$
(3.10)

The three parameters \(\alpha \), \(\beta \) and \(\gamma \) are related to the old ones through scaling.

The first canonical form (3.10) is, up to change of the parameters, the autonomous the second member of the discrete \(P_\text {II}\) hierarchy, the \(\mathrm {d}P_{II}^{(2)}\) equation. The \(\mathrm {d}P_{II}^{(2)}\) equation was presented in [7] and the integrability properties with respect to invariants and growth of the degrees [1, 11, 17, 18, 26] of this equation were investigated in [29]. This equation reappeared later in the classification given in [22], see Sect. 3.1. In [22], the growth properties of Eq. (3.10) were explained proving that such equation is Liouville integrable. Its Lagrangian, found with the method of [19], and the associated symplectic structure were presented. For sake of completeness, here we are going to present again such properties.

The Lagrangian of the first canonical form (3.10) is the following:

$$\begin{aligned} L_{1}&= (X_{n+1}^{2}-1) X_{n+2} X_{n} +\frac{1}{2}X_{n}^{2}X_{n+1}^2 +\gamma X_{n}X_{n+1} +\frac{\alpha }{2} \log \left( X_{n}^{2}-1 \right) \nonumber \\&\quad +\frac{\beta }{2}\log \left( \frac{X_{n}-1}{X_{n}+1} \right) . \end{aligned}$$
(3.11)

The functionally independent invariants of the first canonical form (3.10) are:

$$\begin{aligned} I_{1}&=-X_{{n-1}}X_{{n}} \left( X_{{n-1}}-1 \right) \left( X_{{n}}-1 \right) \alpha - \left( X_{{n-1}}-1 \right) \left( X_{{n}}-1 \right) \beta + \left( -X_{{n-1}}X_{{n}}+1 \right) \gamma \nonumber \\&\quad -X_{{n-1}}X_{{n}} \left( X_{{n}}-1 \right) \left( X_{{n-1}}-1 \right) \left( \begin{matrix} X_{{n-1}}X_{{n}}+X_{{n}}X_{{n+1}} +X_{{n-2}}X_{{n-1}}\\ -X_{{n+1}}X_{{n-2}}-X_{{n}}-X_{{n-1}}-1 \end{matrix} \right) ,\end{aligned}$$
(3.12a)
$$\begin{aligned} J_{1}&=-X_{{n-1}}X_{{n}} \left( X_{{n}}-1 \right) \left( X_{{n-1}}-1 \right) \left( \begin{matrix} X_{{n-1}}X_{{n}}+X_{{n}}X_{{n+1}}+ X_{{n-2}}X_{{n-1}}+X_{{n+1}}X_{{n-2}} \\ -X_{{n}}-X_{{n-2}}-X_{{n-1}}-X_{{ n+1}} \end{matrix} \right) \alpha \nonumber \\&\quad - \left( X_{{n}}-1 \right) \left( X_{{n-1}}-1 \right) \left( X_{{n-1}}X_{{n}}+X_{{n}}X_{{n+1}}+X_{{n-2}}X_{{n-1}}- X_{{n}}-X_{{n-1}}-1 \right) \beta \nonumber \\&\quad + \left( \begin{matrix} -X_{{n}}^{2}X_{{n-1}}^{2}-X_{{n}}^{2}X_{{n-1}}X_{{n+1}}-X_{{n}}X_{{n-2}}X_{{n-1}}^{2} +X_{{n}}^{2}X_{{n-1}}\\ +X_{{n}}X_{{n-2}}X_{{n-1}}+X_{{n}}X_{{n-1}}^{2}+X_{{n}}X_{{n+1}}X_{{n-1}}-1 \end{matrix} \right) \gamma \nonumber \\&\quad -X_{{n-1}}X_{{n}} \left( X_{{n}}-1 \right) \left( X_{{n-1}}-1 \right) \left( X_{{n-1}}X_{{n}}+X_{{ n}}X_{{n+1}}+X_{{n-2}}X_{{n-1}}\right. \nonumber \\&\quad \left. -X_{{n}}-X_{{n-2}}-X_{{n-1}}-X_{{n+1}} \right) \times \nonumber \\&\qquad \left( X_{{n-1}}X_{{n}}+X_{{n}}X_{{n+1}}+X_{{n-2}}X_{{n-1}} -X_{{n}}-X_{{n-1}}-1 \right) \end{aligned}$$
(3.12b)

Finally, the symplectic structure obtained from the Lagrangian (3.11) has the following non-zero brackets:

$$\begin{aligned} \left\{ X_{n+1},X_{n-1} \right\}&= -\frac{1}{X_n^{2}-1},\end{aligned}$$
(3.13a)
$$\begin{aligned} \left\{ X_{n+1},X_{n-2} \right\}&= \frac{2 X_{n} X_{n-1}+2 X_{n} X_{n+1}+2 X_{n-2} X_{n-1}+\gamma }{ X_{n}^2 X_{n-1}^2-X_{n}^2-X_{n-1}^2+1}\end{aligned}$$
(3.13b)
$$\begin{aligned} \left\{ X_{n},X_{n-2} \right\}&= -\frac{1}{X_{n-1}^{2}-1}, \end{aligned}$$
(3.13c)

Using such Poisson structure, it is possible to prove that the invariants (3.12) are commuting. This ends the proof of the integrability of the first canonical form (3.10).

Case 2 If \(\deg g = 2\) and it has one solution \(x_{0}\) of multiplicity two, this solution can be rescaled to 0 through the transformation:

$$\begin{aligned} x_{n} = X_{n} + x_{0}. \end{aligned}$$
(3.14)

So, in case 2 Eq. (3.8) reduces to the second canonical form

$$\begin{aligned}&X_{n+1}^{2} X_{n+2} + X_{n-1}^{2} X_{n-2} +X_{n} \left( X_{n+1}+X_{n-1} \right) ^{2} +\gamma \left( X_{n+1}+X_{n-1}\right) \nonumber \\&\quad + \frac{\alpha }{X_{n}^{2}}+\frac{\beta }{X_{n}}=0. \end{aligned}$$
(3.15)

The three parameters \(\alpha \), \(\beta \) and \(\gamma \) which are related to the old ones through scaling.

The second canonical form (3.15) is, up to change of the parameters, equation (P.v) appearing in the classification of fourth-order difference equations with two invariants of a given form presented in [22]. In [22], the growth properties of Eq. (3.15) were explained proving that such equation is Liouville integrable. Its Lagrangian, found with the method of [19], and the associated symplectic structure, were presented. For sake of completeness, here we are going to present again such properties.

The Lagrangian of the second canonical form (3.15) is the following:

$$\begin{aligned} L_{2} = X_{n+1}^{2}X_{n} X_{n+2} +\frac{1}{2}X_{n}^{2}X_{n+1}^2 +\gamma X_{n}X_{n+1} -\frac{\alpha }{X_{n}}+\beta \log \left( X_{n}\right) . \end{aligned}$$
(3.16)

The functionally independent invariants of the second canonical form (3.15) are:

$$\begin{aligned} I_{2}&=\left( X_{{n-1}}+X_{{n}} \right) \alpha +\beta \ X_{{n}}X_{{n-1}} +X_{{n}}^{2}X_{{n-1}}^{2} \left( X_{{n}}X_{{n-1}}\right. \nonumber \\&\quad \left. +X_{{n}}X_{{n+1}}+X_{{n -1}}X_{{n-2}}-X_{{n-2}}X_{{n+1}}+\gamma \right) \end{aligned}$$
(3.17a)
$$\begin{aligned} J_{2}&=X_{{n-1}}^{2}X_{{n}}^{2} \left( X_{{n-1}}+X_{{n+1}} \right) \left( X_{{n}}+X_{{n-2}} \right) \gamma + \left( X_{{n}}^{2}X_{{n-1}}+X_{{n+1}}X_{{n}}^{2}\right. \nonumber \\&\quad \left. +X_{{n-1}}^{2}X_{{n}} +X_{{n-2}}X_{{n-1}}^{2} \right) \alpha \nonumber \\&\quad +X_{{n-1}}X_{{n}} \left( X_{{n}}X_{{n-1}}+X_{{n}}X_{{n+1}}+X_{{n-2}}X_{{n-1}} \right) \left( X_{{n}}^{2}X_{{n-1}}^{2}+X_{{n+1}}X_{{n}}^{2}X_{{n-1}}\right. \nonumber \\&\quad \left. +X_{{n}}X_{{n-2}}X_{{n-1}}^{2}+\beta \right) . \end{aligned}$$
(3.17b)

Finally, the symplectic structure obtained from the Lagrangian (3.11) has the following non-zero brackets:

$$\begin{aligned} \left\{ X_{n+1},X_{n-1} \right\}&= -\frac{1}{X_n^{2}},\end{aligned}$$
(3.18a)
$$\begin{aligned} \left\{ X_{n+1},X_{n-2} \right\}&= \frac{2 X_{n} X_{n-1}+2 X_{n} X_{n+1}+2 X_{n-2} X_{n-1}+\gamma }{ X_{n}^2 X_{n-1}^2}\end{aligned}$$
(3.18b)
$$\begin{aligned} \left\{ X_{n},X_{n-2} \right\}&= -\frac{1}{X_{n-1}^{2}}, \end{aligned}$$
(3.18c)

Using such Poisson structure, it is possible to prove that the invariants (3.17) are commuting. This ends the proof of the integrability of the second canonical form (3.15).

Case 3 If \(\deg g = 2\) and it has two complex conjugate solutions \(x_{0}=\mu +\mathrm {i}\nu \) and \(x_{0}^{*}=\mu -\mathrm {i}\nu \), these solutions can be scaled to \(\pm \mathrm {i}\) through the transformation:

$$\begin{aligned} x_{n} = \nu X_{n} + \mu . \end{aligned}$$
(3.19)

So in case 3, Eq. (3.8) reduces to the the third canonical form:

$$\begin{aligned}&\left( X_{n+1}^{2}+1\right) X_{n+2} +\left( X_{n-1}^{2}+1\right) X_{n-2} +X_{n} \left( X_{n+1}+X_{n-1} \right) ^{2} +\gamma \left( X_{n+1}+X_{n-1}\right) \nonumber \\&\quad + \frac{\alpha + \beta X_{n}}{X_{n}^{2}+1}=0. \end{aligned}$$
(3.20)

The three parameters \(\alpha \), \(\beta \) and \(\gamma \) are related to the old ones through scaling.

The third canonical form (3.20) is connected to the first one (3.10), if we allow complex changes of variables and complexify the parameters:

$$\begin{aligned} X_{n} \leftrightarrow \mathrm {i}X_{n}, \quad (\alpha ,\beta ,\gamma ) \leftrightarrow (\mathrm {i}\beta ,\alpha ,-\gamma ). \end{aligned}$$
(3.21)

Therefore, the third canonical form (3.20) is a different avatar of the autonomous \(\mathrm {d}P_\text {II}^{(2)}\) equation. We choose to consider it as different equation, because the functional form of the Lagrangian for Eq. (3.20) is different with respect to the one of Eq. (3.10). Moreover, in Sect. 4, we will show that the continuum limit of the third canonical form (3.20) is different from the continuum limit of the second canonical form (3.15).

The Lagrangian of the third canonical form (3.20) is the following:

$$\begin{aligned} L_{3}&= \left( X_{n+1}^{2}+1\right) X_{n} X_{n+2} +\frac{1}{2}X_{n}^{2}X_{n+1}^2 +\gamma X_{n}X_{n+1} +\frac{\alpha }{2}\arctan \left( X_{n}\right) \nonumber \\&\quad +\beta \log \left( X_{n}^{2}+1\right) . \end{aligned}$$
(3.22)

The functionally independent invariants of the third canonical form (3.20) are:

$$\begin{aligned} I_{3}&=\left( X_{{n}}^{2}+1 \right) \left[ \left( X_{{n}}+X_{{n-2}} \right) X_{{n-1}}^{3} +\left( X_{{n}}X_{{n+1}}-X_{{n-2}}X_{{n+1}}+\gamma \right) X_{{n-1}}^{2}\right] \nonumber \\&\quad + \left( \gamma -X_{{n-2}}X_{{n+1}} \right) X_{{n}}^{2}\nonumber \\&\quad + \left[ X_{{n}}^{3}+X_{{n}}^{2}X_{{n-2}}+ \left( \beta +1 \right) X_{{n}}+\alpha +X_{{n-2 }} \right] X_{{n-1}} +X_{{n+1}}X_{{n}}^{3}\nonumber \\&\quad + \left( \alpha +X_{{n+1}} \right) X_{{n}}-X_{{n-2}}X_{{n+1}}\end{aligned}$$
(3.23a)
$$\begin{aligned} J_{3}&=\left( X_{{n}}^{2}+1 \right) \left[ \left( X_{{n}}+X_{{n-2}} \right) ^{2}X_{{n-1}}^{4} +\left( X_{{n}}+X_{{n-2}} \right) \left( 2\ X_{{n}}X_{{n+1}} +\gamma -5 \right) X_{{n-1}}^{3}\right] \nonumber \\&\quad - \left[ \begin{matrix} \left( \left( 5-\gamma \right) X_{{n+1}}-2 X_{{n-2}} \right) X_{{n}}^{3}+ \left( 5\ \gamma -\beta -2 -2 X_{{n-2}}^{2}-X_{{n+1}} \left( \gamma +5 \right) X_{{n-2}} -2 X_{{n+1}}^{2} \right) X_{{n}}^{2}\\ -\left( X_{{n+1}}^{2}+1 \right) X_{{n}}^{4} + \left( \left( 5-\gamma \right) X_{{n+1}} -\alpha -\left( \beta +2 \right) X_{{n-2}}\right) X_{{n}}\\ -2 X_{{n-2}}^{2}- \left( \left( \gamma +5 \right) X_{{n+1}}+\alpha \right) X_{{n-2}}-X_{{n+1}}^{2}+5\ \gamma -1 \end{matrix} \right] X_{{n-1}}^{2}\nonumber \\&\quad - \left[ \begin{matrix} \left( 5-\gamma -2 X_{{n-2}}X_{{n+1}} \right) X_{{n}}^{3}-2 X_{{n+1}}X_{{n}}^{4} + \left( \left( 5 -\gamma \right) X_{{n-2}}- \left( \beta +2 \right) X_{{n+1}} -\alpha \right) X_{{n}}^{2}\\ + \left( 5\ \beta -\gamma +5 -2\ X_{{n-2}}X_{{n+1}} \right) X_{{n}} + \left( 5 -\gamma \right) X_{{n-2}}-X_{{n+1}}\beta +4\alpha \end{matrix} \right] X_{{n-1}}\nonumber \\&\quad +X_{{n+1}}^{2}X_{{n}}^{4} +X_{{n+1}}\left( \gamma -5 \right) X_{{n}}^{3} - \left( 5\ \gamma -1 -X_{{n-2}}^{2}-X_{{n+1}} \left( \gamma +5 \right) X_{{n-2}}\right. \nonumber \\&\quad \left. -X_{{n+1}}\alpha -2 X_{{n+1}}^{2}+ \right) X_{{n}}^{2}\nonumber \\&\quad - \left( 4\ \alpha -X_{{n-2}}\beta + \left( 5-\gamma \right) X_{{n+1}} \right) X_{{n}} +X_{{n-2}}^{2} +\left( \left( \gamma +5 \right) X_{{n+1}}+\alpha \right) X_{{n-2}}\nonumber \\&\quad +X_{{n+1}} \left( \alpha +X_{{n+1}} \right) \end{aligned}$$
(3.23b)

Finally, the symplectic structure obtained from the Lagrangian (3.22) has the following non-zero brackets:

$$\begin{aligned} \left\{ X_{n+1},X_{n-1} \right\}&= -\frac{1}{X_n^{2}+1},\end{aligned}$$
(3.24a)
$$\begin{aligned} \left\{ X_{n+1},X_{n-2} \right\}&= \frac{2 X_{n} X_{n-1}+2 X_{n} X_{n+1}+2 X_{n-2} X_{n-1}+\gamma }{ X_{n}^2 X_{n-1}^2+X_{n}^{2}+X_{n+1}^{2}+1}\end{aligned}$$
(3.24b)
$$\begin{aligned} \left\{ X_{n},X_{n-2} \right\}&= -\frac{1}{X_{n-1}^{2}+1}, \end{aligned}$$
(3.24c)

Using such Poisson structure, it is possible to prove that the invariants (3.23) are commuting. This ends the proof of the integrability of the third canonical form (3.20).

Case 4 If \(\deg g = 1\), it has a single solution \(x_{0}=-\nu /\mu \) which can be moved to 0 through the transformation:

$$\begin{aligned} x_{n} = \frac{X_{n} -\nu }{\mu }. \end{aligned}$$
(3.25)

So in case 4, Eq. (3.8) reduces to the the fourth canonical form:

$$\begin{aligned}&X_{n+1} X_{n+2} + X_{n-1} X_{n-2} +X_{n} \left( X_{n}+ 2X_{n+1}+2X_{n-1} \right) +\left( X_{n+1}+X_{n-1} \right) ^{2}\nonumber \\&\quad -X_{n+1}X_{n-1} +\gamma \left( X_{n}+ X_{n+1}+X_{n-1}\right) +\frac{\alpha }{X_{n}}+\beta =0. \end{aligned}$$
(3.26)

The three parameters \(\alpha \), \(\beta \) and \(\gamma \) which are related to the old ones through scaling.

The fourth canonical form (3.26) is, up to change of the parameters, the autonomous second member of the discrete \(P_\text {I}\) hierarchy, the \(\mathrm {d}P_\text {I}^{(2)}\) equation. The \(\mathrm {d}P_\text {I}^{(2)}\) equation was presented in [7] and the integrability properties with respect to invariants and growth of the degrees of this equation were investigated in [29]. Alongside with Eqs. (3.10) and (3.15), this equation reappeared later in the classification given in [22], see Sect. 3.1. In [22], the growth properties of Eq. (3.26) were explained proving that such equation is Liouville integrable. Its Lagrangian, found with the method of [19], and the associated symplectic structure, were presented. For sake of completeness, here we are going to present again such properties.

The Lagrangian of the fourth canonical form (3.26) is the following:

$$\begin{aligned} L_{4}&= X_{n}X_{n+1} X_{n+2} +X_{n}^{2}X_{n+1}+X_{n}X_{n+1}^{2} +\frac{X_{n}^{3}}{3} +\alpha \log \left( X_{n} \right) +\beta X_{n}\nonumber \\&\quad +\gamma X_{n}\left( X_{n+1}+\frac{X_{n}}{2}\right) \end{aligned}$$
(3.27)

The functionally independent invariants of the fourth canonical form (3.26) are:

$$\begin{aligned} I_{4}&= \left( X_{{n}}+X_{{n-1}} \right) \alpha + \beta X_{{n}}X_{{n-1}} +X_{{n}}X_{{n-1}} \left( X_{{n}}+X_{{n-1}} \right) \gamma \nonumber \\&\quad +X_{{n}}X_{{n-1}} \left( X_{{n}}^{2}+2 X_{{n}}X_{{n-1}}+X_{{n}}X_{{n+1}}+X_{{n-2}} X_{{n-1}}-X_{{n-2}}X_{{n+1}}+X_{{n-1}}^{2} \right) \end{aligned}$$
(3.28a)
$$\begin{aligned} J_{4}&=\alpha (X_{n}^2+2 X_{n} X_{n-1}+X_{n} X_{n+1}+X_{n-2} X_{n-1}+X_{n-1}^2)\nonumber \\&\quad +\beta X_{n} X_{n-1} (X_{n}+X_{n-2}+X_{n-1}+X_{n+1})\nonumber \\&\quad +\gamma X_{n} X_{n-1} (X_{n}+X_{n-1}+X_{n+1})(X_{n}+X_{n-2}+X_{n-1})\nonumber \\&\quad +X_{n} X_{n-1} (X_{n}+X_{n-2}+X_{n-1}+X_{n+1}) (X_{n}^2+2 X_{n} X_{n-1}\nonumber \\&\quad +X_{n} X_{n+1}+X_{n-2} X_{n-1}+X_{n-1}^2) \end{aligned}$$
(3.28b)

We note that the invariant (3.28b) does not follow from substitution of parameters into the general higher degree invariant obtained for Eq. (3.8).

Finally, the symplectic structure obtained from the Lagrangian (3.27) has the following non-zero brackets:

$$\begin{aligned} \left\{ X_{n+1},X_{n-1} \right\}&= -\frac{1}{X_n},\end{aligned}$$
(3.29a)
$$\begin{aligned} \left\{ X_{n+1},X_{n-2} \right\}&= \frac{2 X_{n} + 2 X_{n-1}+ X_{n-2} + X_{n+1}+\gamma }{ X_{n}X_{n-1}}\end{aligned}$$
(3.29b)
$$\begin{aligned} \left\{ X_{n},X_{n-2} \right\}&= -\frac{1}{X_{n-1}}, \end{aligned}$$
(3.29c)

Using such Poisson structure, it is possible to prove that the invariants (3.28) are commuting. This ends the proof of the integrability of the fourth canonical form (3.26).

Case 5 If \(\deg g = 0\) Eq. (3.8) can be transformed into the following linear equation:

$$\begin{aligned} X_{n+2}+ X_{n-2} +\gamma \left( X_{n+1}+X_{n-1}\right) +\beta X_{n} + \alpha =0. \end{aligned}$$
(3.30)

This is the fifth canonical form. The fifth canonical form (3.30) is a degenerate case as it is linear.

The Lagrangian of the fifth canonical form (3.30) is the following:

$$\begin{aligned} L_{5} = X_{n}X_{n+2} +\alpha X_{n} +\frac{\beta }{2}X_{n}^{2} +\gamma X_{n}X_{n+1}. \end{aligned}$$
(3.31)

The functionally independent invariants of the fifth canonical form (3.30) are:

$$\begin{aligned} I_{5}&=\alpha (X_{n}+X_{n-1})+\beta X_{n} X_{n-1} +\gamma (X_{n}^2+X_{n-1}^2)\nonumber \\&\quad +X_{n} (X_{n-1}+X_{n+1})+X_{n-2}( X_{n-1}- X_{n+1}), \end{aligned}$$
(3.32a)
$$\begin{aligned} J_{5}&= \alpha (X_{n}+X_{n-2}+X_{n-1}+X_{n+1}) +\beta (X_{n} X_{n-2}+X_{n-1} X_{n+1}) \nonumber \\&\quad +\gamma (X_{n-1}+X_{n+1}) (X_{n}+X_{n-2}) \nonumber \\&\quad +X_{n}^2+X_{n-2}^2+X_{n-1}^2+X_{n+1}^2. \end{aligned}$$
(3.32b)

We note that the invariant (3.32b) is quadratic and does not follow from substitution of parameters into the general higher degree invariant obtained for Eq. (3.8).

Finally, the symplectic structure obtained from the Lagrangian (3.31) has the following non-zero brackets:

$$\begin{aligned} \left\{ X_{n+1},X_{n-1} \right\} = \left\{ X_{n},X_{n-2} \right\} = -1, \quad \left\{ X_{n+1},X_{n-2} \right\} = \gamma . \end{aligned}$$
(3.33)

Using such Poisson structure, it is possible to prove that the invariants (3.32) are commuting. This ends the proof of the integrability of the fifth canonical form (3.30).

Remark 5

Following the results of Example 3, we have that the fifth canonical form is (up to reparametrisation) the most general linear fourth-order difference equation admitting an autonomous discrete Lagrangian.

To end this section, we summarise our results in the following theorem:

Theorem 4

If an additive variational difference equation of the form (2.5) admits a multi-affine invariant with respect to the variables \(x_{n+1}\) and \(x_{n-2}\), then it is Liouville integrable. Moreover, using a linear transformation it can be brought into one of the five canonical forms given by Eqs. (3.10), (3.15), (3.20), (3.26) and (3.30).

4 Continuum limits of the integrable cases

In this section, we discuss the continuum limits of the five canonical forms. We will prove that, under appropriated scaling of the dependent variable and of the parameters, the continuum limit is given by either by the autonomous second member of the \(P_\text {I}\) hierarchy, the \(P_\text {I}^{(2)}\) equation [8, 32]:

$$\begin{aligned} x^{ \mathrm {iv}} +10 x x''+\frac{r_1}{2} x''+5 \left( x'\right) ^2+10 x^3 +\frac{3}{2} r_{1} x^2+2 r_{2} x+r_{3}=0, \end{aligned}$$
(4.1)

or by the autonomous second member of the \(P_\text {II}\) hierarchy, the \(P_\text {II}^{(2)}\) equation [13]:

$$\begin{aligned} x^{ \mathrm {iv}}-(10 x^2+r_{1}) x''+6 x^5+2r_{1} x^3 -10 x (x')^2+r_{2} =0. \end{aligned}$$
(4.2)

The fifth canonical form, i.e. the Eq. (3.30), is a special case. The natural continuum limit of the fifth canonical form (3.30) is the linear equation:

$$\begin{aligned} x^{ \mathrm {iv}} + r_{1} x'' + r_{2} x + r_{3}=0. \end{aligned}$$
(4.3)

As discussed in the general non-autonomous case in [8, 13, 32], Eq. (4.1) and Eq. (4.2) are integrable fourth-order equations. Being linear Eq. (4.3) is clearly integrable. For sake of completeness, here we show their integrals and their Lagrangian. We note that the Lagrangian for (4.2) was already presented in [19] using the continuum limit approach.

Equation (4.1) possesses the following first integrals

$$\begin{aligned} K_{1,\text {I}}&= x' x'''+\frac{5 x^4}{2}+\frac{ r_{1}}{2}x^3 +r_{2}x^2 +\frac{x}{16} \left[ 80 (x')^2+16 r_{3})\right] +\frac{r_{1}}{4} (x')^2-\frac{(x'')^2}{12} \end{aligned}$$
(4.4a)
$$\begin{aligned} K_{2,\text {I}}&= (x''')^2 +(20 x+r_{1}) \frac{(x'')^2}{2} -(60 x^2+6 x r_{1}+4 r_{2}) \frac{(x')^2}{2}\nonumber \\&\quad +(40 x^3+6 x^2 r_{1}+8 x r_{2}-4 x'^2+4 r_{3})\frac{ x''}{2}\nonumber \\&\quad -\frac{3x^{2}}{2} \left( r_{1} x^2 +4 x^3+\frac{8r_{2}}{3} x +4 r_{3}\right) , \end{aligned}$$
(4.4b)

while Eq. (4.2) possesses the following first integrals:

$$\begin{aligned} K_{1,\text {II}}&= x' x''' -\frac{(x'')^2}{2}-(10 x^2+r_{1}) \frac{(x')^2}{2} +\frac{ x}{2} (2 x^5+r_{1} x^3-r_{2}x -2 r_{3}), \end{aligned}$$
(4.5a)
$$\begin{aligned} K_{2,\text {II}}&= (x''')^2-(10 x^2+r_{1}) (x'')^2 +(x')^4+(30 x^4+6 r_{1} x^2-r_{2}) (x')^2 \nonumber \\&\quad +\left[ 12 x^5+4 r_{1} x^3+4 x (x')^2-2r_{2} x -2 r_{3}\right] x''\nonumber \\&\quad +x^{3}\left[ 3 x^4\left( x-r_{2}\right) + 2 r_{1}x^3 -8 r_{3}\right] . \end{aligned}$$
(4.5b)

Moreover, Eq. (4.1) can be derived by the following Lagrangian:

$$\begin{aligned} L_\text {I} = \frac{(x'')^{2}}{2} + x\left( 21 x+r_{{1}} \right) \frac{x''}{4} +\frac{11x}{2} \left( x' \right) ^{2} +\frac{x}{2}\left( 5 x^{3}+r_{{1}} x^{2}+2 r_{{2}}x+2 r_{{3}} \right) , \end{aligned}$$
(4.6)

while Eq. (4.2) can be derived by the following Lagrangian:

$$\begin{aligned} L_\text {II} = \frac{(x'')^{2}}{2} -x\left( \frac{5x^2}{3}+\frac{r_1}{2}\right) x'' +x\left( x^5+\frac{r_{1}}{2}x^3+r_{2}\right) . \end{aligned}$$
(4.7)

We recall that following [12], these Lagrangians are unique up to the addition of a total derivative and multiplication by a scalar. Finally, Eq. (4.3) can be derived by the following Lagrangian:

$$\begin{aligned} L_\text {lin} = \frac{(x'')^{2}}{2}-\frac{r_1}{2} \left( x' \right) ^2 + \frac{r_1}{2} x^2+ r_{3} x. \end{aligned}$$
(4.8)

Remark 6

We note that according to the result of [12] the most general variational fourth-order linear differential equation is the following one:

$$\begin{aligned} x^{ \mathrm {iv}} + r_{0} x''' +r_{1} x'' + \frac{r_{0}}{2} \left( r_{1}-\frac{r_{0}^2}{4}\right) x'+r_{2}x+r_{3}=0. \end{aligned}$$
(4.9)

The Lagrangian of the above equation is:

$$\begin{aligned} L_{F} = e^{r_{0}t/2} \left[ \frac{(x'')^{2}}{2}+\left( \frac{r_{0}^{2}}{8}-\frac{r_1}{2}\right) \left( x' \right) ^2 + \frac{r_1}{2} x^2+ r_{3} x \right] . \end{aligned}$$
(4.10)

It follows from this consideration that Eq. (4.3) is the most general fourth-order linear differential equation admitting an autonomous Lagrangian.

4.1 Equations reducing to Eq. (4.1)

The second canonical form (3.15) under the following scaling:

$$\begin{aligned} x_{n}&=1 +\frac{h^{2}}{2} x(t), \, t = nh, \, \alpha = -16+2 r_{1} h^2-2 r_{2} h^4, \, \beta = 30-3 r_{1} h^2+2 r_{2} h^4, \,\nonumber \\ \gamma&= -10+\frac{r_{1}}{2} h^2+\frac{r_{3}}{4} h^6, \end{aligned}$$
(4.11)

in the limit \(h\rightarrow 0\) reduces to Eq. (4.1). With the same scaling as \(h\rightarrow 0\), we have:

$$\begin{aligned} \frac{4 L_{2}}{h^{8}} {\mathop {\equiv }\limits ^{\text {t.d.}}}L_\text {I} + O\left( h \right) , \end{aligned}$$
(4.12)

and

$$\begin{aligned} I_{2} = -\frac{K_{1,\text {I}}}{2} h^{8} + O(h^{9}),\, J_{2} = -\left( \frac{K_{1,\text {I}}}{32}+\frac{r_{1}r_{3}}{32}\right) h^{8} + O(h^{9}). \end{aligned}$$
(4.13)

That is, the two invariants collapse in a single first integral in the continuum limit and (4.4b) is not recovered.

Remark 7

This result on the second canonical form (3.15) shows that the new equation found in [22] can be interpreted as new autonomous fourth-order \(\mathrm {d}P_\text {I}\) equation. We conjecture that Eq. (3.15) is the fourth-order member of a “non-standard” \(\mathrm {d}P_\text {I}\) hierarchy. At the moment, no information on the existence of this hierarchy is available.

The third canonical form (3.20) under the following scaling:

$$\begin{aligned} x_{n}&=1 + h^{2} x(t), \, t = nh, \, \alpha = -16+4 r_{1} h^2-4 r_{2} h^4, \, \beta = 56-8 r_{1} h^2, \,\nonumber \\ \gamma&= -14+r_{1} h^2+r_{2} h^4+r_{3} h^6, \end{aligned}$$
(4.14)

in the limit \(h\rightarrow 0\) reduces to Eq. (4.1). With the same scaling as \(h\rightarrow 0\), we have:

$$\begin{aligned} \frac{L_{3}}{h^{8}} {\mathop {\equiv }\limits ^{\text {t.d.}}}L_\text {I} + O\left( h \right) , \end{aligned}$$
(4.15)

and

$$\begin{aligned} I_{3} = -8 K_{1,\text {I}} h^{8} + O(h^{9}),\, J_{3} = -\left( 136 K_{1,\text {I}}+\frac{6r_{1}r_{3}+5r_{2}^{2}}{17}\right) h^{8} + O(h^{9}). \end{aligned}$$
(4.16)

That is, the two invariants collapse in a single first integral in the continuum limit and (4.4b) is not recovered.

Remark 8

Despite being connected with the \(P_\text {II}^{(2)}\) equation, the simplest continuum limit of the third canonical form (3.15) is a member of the \(P_\text {I}\) hierarchy. No continuum limit of Eq. (3.10) to the autonomous fourth-order member of the \(P_\text {II}\) hierarchy is at present known. As in Remark 7, we conjecture the third canonical form (3.20) is the fourth-order member of a “non-standard” \(\mathrm {d}P_\text {I}\) hierarchy.

The fourth canonical form (3.26) under the following scaling:

$$\begin{aligned} x_{n}&=1 + h^{2} x(t), \, t = nh, \, \alpha = -10+\frac{3 r_{1}}{2} h^2-r_{2}h^4 , \, \beta = 30-3r_{1} h^2 , \,\nonumber \\ \gamma&=-10+\frac{r_{1}}{2} h^2+\frac{r_{2}}{3} h^4+ \frac{r_{3}}{3} h^6, \end{aligned}$$
(4.17)

in the limit \(h\rightarrow 0\) reduces to Eq. (4.1). With the same scaling as \(h\rightarrow 0\), we have:

$$\begin{aligned} \frac{L_{4}}{h^{8}} {\mathop {\equiv }\limits ^{\text {t.d.}}}L_\text {I} + O\left( h \right) , \end{aligned}$$
(4.18)

and

$$\begin{aligned} I_{4} = 2 K_{1,\text {I}} h^{8} + O(h^{9}),\, J_{4} = \left( 32 K_{1,\text {I}}+\frac{6r_{1}r_{3}}{24}+\frac{r_{2}^{2}}{36}\right) h^{8} + O(h^{9}). \end{aligned}$$
(4.19)

That is, the two invariants collapse in a single first integral in the continuum limit and (4.4b) is not recovered. This continuum limit was first discussed in [8].

4.2 Equations reducing to Eq. (4.2)

The first canonical form (3.10) under the following scaling:

$$\begin{aligned} x_{n} = h x(t), \, t = nh, \, \alpha = 6+2 r_{1} h^2 ,\, \beta = r_{2} h^5 , \, \gamma = 4+r_{1} h^2, \end{aligned}$$
(4.20)

in the limit \(h\rightarrow 0\) reduces to Eq. (4.2). With the same scaling as \(h\rightarrow 0\) we have:

$$\begin{aligned} \frac{L_{1}}{h^{6}} {\mathop {\equiv }\limits ^{\text {t.d.}}}-L_\text {II} + O\left( h \right) , \end{aligned}$$
(4.21)

and

$$\begin{aligned} I_{1} = -\frac{1}{32} K_{1,\text {II}} h^{6} + O(h^{7}),\, J_{1} = \frac{3}{16} K_{1,\text {II}}h^{6} + O(h^{7}). \end{aligned}$$
(4.22)

That is, the two invariants collapse in a single first integral in the continuum limit and (4.5b) is not recovered. This continuum limit was first discussed in [7].

4.3 Equation reducing to Eq. (4.3)

The fifth canonical form (3.30) under the following scaling:

$$\begin{aligned} x_{n} = x(t), \, t = nh, \, \alpha = r_{3} h^{4}, \, \beta = 6 - 2r_{1}h^2+r_{2} h^4, \, \gamma = -4 + r_{1}h^{2}, \end{aligned}$$
(4.23)

in the limit \(h\rightarrow 0\) reduces to Eq. (4.3). Using the same scaling we have that the discrete Lagrangian (3.31) has the following limit as \(h\rightarrow 0\):

$$\begin{aligned} \frac{L_{5}}{h^{4}} {\mathop {\equiv }\limits ^{\text {t.d.}}}L_\text {lin} + O\left( h \right) . \end{aligned}$$
(4.24)

Since Eqs. (3.30) and (4.3) are linear instead of discussing the relationship between the invariants, we discuss the relationship between the explicit solutions. The explicit solution of Eq. (3.30) is obtained as linear combination of the base solutions \(X_{n,i} = q_{i}^{n}\), where \(q_{i}\) are the four roots of the characteristic polynomial:

$$\begin{aligned} q^{4} + \gamma q^{3} + \beta q^{2} +\gamma q + 1 =0, \end{aligned}$$
(4.25)

plus a particular solution of the inhomogeneous equation. In the same way, the general solution of (4.3) is obtained through as linear combination of the base solutions \(x_{n,i} = e^{\mu _{i} t}\), where \(\mu _{i}\) are the four roots of the characteristic polynomial:

$$\begin{aligned} \mu ^{4} + r_{1}\mu ^{2} + r_{2} =0, \end{aligned}$$
(4.26)

plus a particular solution of the inhomogeneous equation. The solutions of Eq. (4.26) are obtained from the solutions of Eq. (4.25) using the scaling given in formula (4.23) and

$$\begin{aligned} q = 1 + \mu h, \end{aligned}$$
(4.27)

in the limit where \(h\rightarrow 0\). Indeed, using formula (4.27) into (4.25) we obtain:

$$\begin{aligned} \left( \mu ^{4} + r_{1}\mu ^{2} + r_{2} \right) h^{4} + O\left( h^{5} \right) = 0. \end{aligned}$$
(4.28)

Finally, using \(t = n h\) the base solutions are such that:

$$\begin{aligned} X_{n,i} = \left( 1+\mu _{i} h \right) ^{t/h} = e^{\mu _{i} t} + O(h)=x_{i}(t)+O(h). \end{aligned}$$
(4.29)

An analogous result holds for the particular solution if we write down its expression using the method of variation of constants [10].

5 Conclusions

In this paper, we discussed the conditions for an additive fourth-order difference equations to be variational. Our main result, stated in Theorem 2, tells us that there exists a family of such equations depending on two arbitrary functions, one of a single variable \(g=g\left( \xi \right) \), and one of two variables \(V=V\left( \xi ,\eta \right) \), and on an arbitrary constant \(\lambda \). As evidenced in Corollary 1, the Lagrangian is autonomous if and only if \(\lambda =1\).

Additive difference equations can be considered also for 2kth-order difference equation:

$$\begin{aligned} x_{n+k} = f\bigl ( \mathbf {x}_{n}^{(-k+1,k-1)} \bigr ) x_{n-k} +h\bigl ( \mathbf {x}_{n}^{(-k+1,k-1)} \bigr ), \end{aligned}$$
(5.1)

where

$$\begin{aligned} \mathbf {x}_{n}^{(m,l)} = \left( x_{n+m},\ldots ,x_{n+l} \right) , \quad l\le m. \end{aligned}$$
(5.2)

The result of this paper stimulates to consider the following conjecture:

Conjecture

An additive 2kth-order difference equation is variational if and only if it can be derived from the following Lagrangian:

$$\begin{aligned} L_{n}^{(k)} = \lambda ^{-n} \left[ f\bigl ( \mathbf {x}_{n}^{(1,k-1)} \bigr ) x_{n}x_{n+k} +V\bigl ( \mathbf {x}_{n}^{(0,k-1)} \bigr ) \right] . \end{aligned}$$
(5.3)

The study of this conjecture will be subject of further studies. A starting point for these studies is the known hierarchies of discrete equations, e.g. those presented in [7, 8].

Moreover, we produced a list of integrable equations with autonomous Lagrangian using an ansatz on the shape of one invariant. Interestingly enough, equations of the said list naturally possess a second invariant without imposing any additional conditions. We showed that it is possible to reduce these equations to five canonical forms, which we related to known examples from [7, 8, 22, 29]. We remark that in the cited papers, the same equations were derived or studied with different approaches.

Finally, we computed the continuum limits of the canonical forms. This allowed us to identify Eq. (3.15), an equation recently introduced in [22], with a new \(\mathrm {d}P_\text {I}^{\left( 2 \right) }\) equation. Moreover, the continuum limits showed that Eq. (3.20), which is related to the \(\mathrm {d}P_\text {II}^{(2)}\) equation, is actually a discretisation of the \(P_\text {I}^{\left( 2 \right) }\) equation. In the same way we proved, following the example given in [19], that variational structures are preserved upon continuum limit, while invariants are not. A resuming table of the integrable case, and their continuum limits can be found in Table 1.

Table 1 Resuming table of the integrable canonical forms

Now, we would like to propose a interpretation of the appearance of non-autonomous Lagrangians in Theorem 2 based on the analogy with the continuum systems. From the results of Example 3 and from the continuum limit (4.3) of the fifth canonical from (3.30), we infer that non-autonomous Lagrangians are linked to some form of dissipation or accretion. We propose this analogy for two main reasons. First, because in the continuum limit (4.3), odd-order derivates are absent. Odd-order derivates are naturally related to dissipation or accretion in continuous systems. Second, we can prove that the additive variational fourth-order equations with non-autonomous Lagrangians are not measure preserving, but they either shrink or expand the volume of the phase space. Computing the Jacobian determinant of (2.5), we obtain:

$$\begin{aligned} J_{n} = \lambda ^{2} \frac{g\left( x_{n-1} \right) }{g\left( x_{n+1} \right) }. \end{aligned}$$
(5.4)

This implies that the volume element is given by:

$$\begin{aligned} V_{n} = g\left( x_{n} \right) g\left( x_{n-1} \right) {{\,\mathrm{d}\,}}x_{n+1}\wedge {{\,\mathrm{d}\,}}x_{n}\wedge {{\,\mathrm{d}\,}}x_{n-1}\wedge {{\,\mathrm{d}\,}}x_{n-2} \end{aligned}$$
(5.5)

and evolves according to:

$$\begin{aligned} V_{n+1} = \lambda ^{2} V_{n}, \end{aligned}$$
(5.6)

that is \(V_{n} = \lambda ^{2n} V_{0}\). We obtain that if \(|\lambda |>1\) the volume of the phase space is increasing, while if \(0<|\lambda |<1\) the volume of the phase space is decreasing. This is another usual feature of continuous accretive and dissipative equations, respectively. If and only if \(|\lambda |=1\), we have the conservation of the volume as required by the Hamiltonian approach. For the above reasons, we say the autonomous Lagrangian case is conservative, while the non-autonomous one is dissipative or accretive depending on the absolute value of \(\lambda \). The case \(\lambda =-1\) preserves the volumes, but since the associated Lagrangian is non-autonomous the corresponding symplectic form does not allows to apply the discrete Liouville theorem. This behaviour is displayed graphically in Fig. 1 in the case of the first canonical form (3.10) and its asymmetric version obtained from the discrete Lagrangian \(L_{n,1}=\lambda ^{-n}L_{1}\) with a given \(\lambda \in \left( -1,1 \right) \).

Fig. 1
figure 1

In blue a trajectory of Eq. (3.10) with \(A_{5}=2\), \(A_{6}=0\), \(A_{7}=-1\) and initial conditions \(x_{i}\sim 10^{-2}\). In red a trajectory of the equation obtained from \(L_{n,1}=\lambda ^{-n}L_{1}\), with \(\lambda =0.999\), same parameters and same initial conditions. While the trajectory of (3.10) oscillated around the fixed point in the origin, the asymmetric trajectory collapse into it as \(n\rightarrow \infty \). Trajectories are computed using \(10^{4}\) iterations

It is well known that dissipative and accretive systems are not integrable in the Liouville sense, as they fail to preserve the measure of the phase space. On the other side, in the continuous setting it is also known that some dissipative systems admit time-dependent first integrals [5, 30]. Up to our knowledge such possibility has never been explored in the discrete setting, so this raises the following question:

Problem

Do non-trivial variational discrete systems admitting n-dependent invariants exist?

Here, by non-trivial we mean a system for which it is not possible to write down the general solution and invert it with respect to the initial conditions in order to get the n-dependent invariants. This restriction is important to rule out linear system, for which this procedure is always possible. This problem might be interesting from the point of view of applications as in several real cases one might need to take into account dissipative effects caused, e.g. by friction. We are planning to address to this problem in a future study.

Other application of the result of this paper can arise in the field of geometric integration theory [3, 4, 31]. Geometric integration theory is a branch of numerical analysis which deals in preserving properties when discretising a continuous system. The variational structure might be such a property. For instance, consider the following Lagrangian:

$$\begin{aligned} L = \frac{\left( x'' \right) ^{2}}{2} -\alpha \frac{\left( x' \right) ^{4}}{12} + \frac{\omega ^{2}}{2}x^{2}-\beta x \end{aligned}$$
(5.7)

and its Euler–Lagrange equation:

$$\begin{aligned} x^{ \mathrm {iv}} + \alpha \left( x' \right) ^{2} x''+ \omega ^{2} x = \beta . \end{aligned}$$
(5.8)

A trivial discretisation of Eq. (5.8) is obtained by replacing the derivatives with the discrete derivatives:

$$\begin{aligned} x' \rightarrow \delta _{n} x_{n} = \frac{x_{n}-x_{n-1}}{h}. \end{aligned}$$
(5.9)

The resulting discrete equation is (up to translation in n):

$$\begin{aligned}&\frac{x_{n+2}-4 x_{n+1}+6 x_{n}-4 x_{n-1}+x_{n-2}}{h^4} +\alpha \frac{(x_{n-1}-x_{n-2})^2 (x_{n}-2 x_{n-1}+x_{n-2})}{h^4}\nonumber \\&\quad +\omega ^2 x_{n-2}=\beta . \end{aligned}$$
(5.10)

This equation is nor invertible nor variational. On the other hand, there exist infinitely many variational discretisation of Eq. (5.9) with the following hypotheses:

  • \(\lambda =1\),

  • the function g is a constant,

  • the functions M and N in (2.19) are third-order polynomials in their variables,

  • the coefficients of M and N are second-order polynomials in h.

An example is the following one:

$$\begin{aligned}&x_{n+2} -4 x_{n+1} +\left( 6-\omega ^{2}h^{4}\right) x_{n} -4x_{n-1}+ x_{n-2}\nonumber \\&\quad +\frac{\alpha }{3}\left( x_{n+1}+x_{n-1}-2x_{n} \right) \left( x_{n+1}^{2}+x_{n}^{2}+x_{n-1}^{2}-x_{n+1}x_{n}\right. \nonumber \\&\quad \left. -x_{n+1}x_{n-1}-x_{n}x_{n-1} \right) =h^{4}\beta . \end{aligned}$$
(5.11)

This discretisation is variational by construction. We argue that this kind of discretisation, even in the non-integrable case, might be convenient from a numerical point of view. This topic will be subject of future studies. We note that some ad hoc constructions of variational discretisation of fourth-order difference equation was given in [27].

Finally, additive fourth-order difference equations are not the only possible generalisation of second-order equations. For instance, in [6] several integrable equations of multipliticative form were derived:

$$\begin{aligned} x_{n+2}x_{n-2} = F\left( x_{n+1},x_{n},x_{n-1} \right) . \end{aligned}$$
(5.12)

In an upcoming paper, we are addressing the problem of giving necessary and sufficient conditions on the existence of a variational structure of such equations and study their integrability properties.