2.1.2. Velocities

Let us suppose now that, instead of depending on *x*, *y*(*t*) depends linearly on *x*˙(*s*) through

$$y(t) = G[t, \dot{\mathfrak{x}}(\mathbf{s})] := \int\_0^T \mathbb{K}(t, \mathbf{s}) \, \dot{\mathfrak{x}}(\mathbf{s}) \, d\mathbf{s} \,. \tag{49}$$

We repeat what we did previously: we consider *<sup>x</sup>*<sup>∗</sup>(*t*), *y*<sup>∗</sup>(*t*) and write *x*(*t*) = *x*<sup>∗</sup>(*t*) + *εη*(*t*), which supposes now that

$$y(t) = y^\*(t) + \varepsilon G[t, \dot{\eta}(s)].\tag{50}$$

With this, the action becomes again a function of *ε* with the condition of the stationary trajectories given by:

$$\frac{d}{d\varepsilon} \int\_0^T \mathcal{L}(t, \mathbf{x}, y) \, dt = \int\_0^T \left( \frac{\partial \mathcal{L}(t, \mathbf{x}, y)}{\partial \mathbf{x}} \eta(t) + \frac{\partial \mathcal{L}(t, \mathbf{x}, y)}{\partial y} \mathcal{G}[t, \dot{\eta}(s)] \right) dt = 0 \,. \tag{51}$$

Substituting the value of *G*, we have

$$\begin{split} &\int\_{0}^{T} \left( \frac{\partial L(t,x,y)}{\partial x} \eta(t) + \frac{\partial L(t,x,y)}{\partial y} \int\_{0}^{T} K(t,s) \eta(s) \, ds \right) dt = 0 \\ &\iff \quad \int\_{0}^{T} \left( \frac{\partial L(t,x,y)}{\partial x} \eta(t) - \frac{\partial L(t,x,y)}{\partial y} \int\_{0}^{T} \frac{\partial K(t,s)}{\partial s} \eta(s) \, ds \right) dt = 0 \\ &\iff \quad \int\_{0}^{T} \int\_{0}^{T} \left( \frac{\partial L(t,x,y)}{\partial x} \eta(s) \delta(t-s) - \frac{\partial L(t,x,y)}{\partial y} \frac{\partial K(t,s)}{\partial s} \eta(s) \right) ds \, dt = 0 \\ &\iff \quad \int\_{0}^{T} \int\_{0}^{T} \left( \frac{\partial L(t,x,y)}{\partial x} \delta(t-s) - \frac{\partial L(t,x,y)}{\partial y} \frac{\partial K(t,s)}{\partial s} \right) dt \, \eta(s) ds = 0 \\ &\implies \quad \int\_{0}^{T} \left( \frac{\partial L(t,x,y)}{\partial x} \delta(t-s) - \frac{\partial L(t,x,y)}{\partial y} \frac{\partial K(t,s)}{\partial s} \right) dt = 0. \end{split} \tag{52}$$

From here we ge<sup>t</sup> as Euler–Lagrange equation

$$\frac{\partial L(s,x,y)}{\partial x} - \int\_0^T \frac{\partial L(t,x,y)}{\partial y} \frac{\partial K(t,s)}{\partial s} \, dt = 0$$

$$\iff \quad \frac{\partial L(t,x,y)}{\partial x} - \frac{\partial}{\partial t} \int\_0^T \frac{\partial L(s,x,y)}{\partial y} K(s,t) \, ds = 0,\tag{53}$$

where we have interchanged in the last step the names of the variables *s* and *t*. As in the previous case, where *y* depended only on positions, the evolution of the system at time *t* depends on both past and future values.

#### 2.1.3. Extension of the Velocities Case

We may also consider the following possibility: *y* depends on *x* as given by Equation (46), and *L* depends on *x* and *y* but also on *y*˙.

Since the procedure is linear, we may consider just that *L* depends on *x* and *y*˙. The necessary condition for stationary trajectories becomes:

$$\int\_{0}^{T} \left( \frac{\partial L(t, \mathbf{x}, y')}{\partial \mathbf{x}} \eta(t) + \frac{\partial L(t, \mathbf{x}, y')}{\partial y'} \frac{d}{dt} \int\_{0}^{T} K(t, s) \eta(s) \, ds \right) dt = 0 \,. \tag{54}$$

Operating similarly as before, we have:

$$\begin{split} \Longrightarrow & \frac{\partial L(\mathbf{s}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{x}} \quad + \quad \int\_{0}^{T} \frac{\partial L(\mathbf{t}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} \frac{\partial K(\mathbf{t}, \mathbf{s})}{\partial \mathbf{t}} dt = 0 \\ \Longrightarrow & \frac{\partial L(\mathbf{s}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{x}} \quad + \quad \left[ \frac{\partial L(\mathbf{t}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K(\mathbf{t}, \mathbf{s}) \right]\_{t=0}^{t=T} \frac{\partial}{\partial t} \frac{\partial L(\mathbf{t}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K(\mathbf{t}, \mathbf{s}) dt = 0 \\ \Longrightarrow & \frac{\partial L(\mathbf{s}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{x}} \quad + \quad \frac{\partial L(\mathbf{T}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K(\mathbf{T}, \mathbf{s}) - \frac{\partial L(\mathbf{0}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K(\mathbf{0}, \mathbf{s}) \\ & \qquad \qquad - \quad \int\_{0}^{T} \frac{\partial}{\partial t} \frac{\partial L(\mathbf{t}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K(\mathbf{t}, \mathbf{s}) dt = 0. \end{split} \tag{55}$$

Or, otherwise:

$$
\implies \frac{\partial L(\mathbf{s}, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{x}} \quad - \quad \int\_0^T \frac{\partial}{\partial t} \frac{\partial L(t, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} \text{ K}(t, \mathbf{s}) dt = 0,\tag{56}
$$

if we consider that *L* and its derivatives are all zero at the boundaries. As before, we may rewrite this as:

$$\begin{aligned} \frac{\partial L(t, \mathbf{x}, \dot{\mathbf{y}})}{\partial \mathbf{x}} &+ \quad \frac{\partial L(T, \mathbf{x}, \dot{\mathbf{y}})}{\partial \dot{\mathbf{y}}} K(T, t) - \frac{\partial L(0, \mathbf{x}, \dot{\mathbf{y}})}{\partial \dot{\mathbf{y}}} K(0, t) \\ &- \quad \int\_0^T \frac{\partial}{\partial s} \frac{\partial L(s, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K(s, t) ds = 0 \end{aligned} \tag{57}$$

or, as:

$$\frac{\partial L(t, x, \dot{y})}{\partial x} - \int\_0^T \frac{\partial}{\partial s} \frac{\partial L(s, x, y')}{\partial y'} \, K(s, t) ds = 0 \,. \tag{58}$$

We have, once more, this dependency on values from the past and from the future.

#### 2.1.4. General Case

We may consider a Lagrangian with three variables, for instance, *y*1 depending on *x*, *y*˙1, and *y*2 depending on *x*˙, through two linear functionals, as above, with kernels *K*1 and *K*2, respectively:

$$y\_1(t) = \int\_0^T K\_1(t, s) \ge (s) \, ds, \qquad y\_2(t) = \int\_0^T K\_2(t, s) \, \dot{x}(s) \, ds. \tag{59}$$

In that case, due to the linearity of all the previous manipulations, the Euler–Lagrange equation will just have a contribution from each and be of the form:

$$\begin{split} \frac{\partial L(t, \mathbf{x}, y\_1, y\_2, \dot{y}\_1)}{\partial \mathbf{x}} &\quad + \quad \int\_0^T \frac{\partial L(s, \mathbf{x}, y\_1, y\_2, y\_1')}{\partial y\_1} K\_1(s, t) \, ds \\ &\quad - \quad \int\_0^T \frac{\partial}{\partial s} \frac{\partial L(s, \mathbf{x}, y\_1, y\_2, y\_1')}{\partial y\_1'} K\_1(s, t) \, ds \\ &\quad - \quad \frac{\partial}{\partial t} \int\_0^T \frac{\partial L(s, \mathbf{x}, y\_1, y\_2, y\_1')}{\partial y\_2} K\_2(s, t) \, ds = 0 \,. \end{split} \tag{60}$$

This reminds us of the original calculus of variations (i.e., local and nonfractional) with higher order formulation. The case, for instance, of a Lagrangian that depends on *x*, *x*˙ and *x*¨.

#### 2.1.5. Fractional Integrals

We may obtain fractional integrals for *y* given by Equation (46) choosing, for instance, the following kernel:

$$K\_{I^{+}}(t,s) = \frac{1}{\Gamma(\alpha)} \frac{\Theta(t-s)}{(t-s)^{1-\alpha}} \, ^{\prime} \tag{61}$$

where *α* > 0 and Θ is the heavyside function:

$$\Theta(s) = \begin{cases} \ 0, \text{ if } s \le 0 \\\ 1, \text{ if } s > 0 \end{cases} \tag{62}$$

Kernel Equation (61) gives us the left-sided Riemann–Liouville integral with lower boundary 0:

$$y(t) = {}\_{0} {}^{l}l\_{t}^{a} \mathbf{x}(t) := \frac{1}{\Gamma(a)} \int\_{0}^{t} \frac{\mathbf{x}(s)}{(t-s)^{1-a}} \, \text{} \tag{63}$$

while interchanging the variables and considering *KI*− (*<sup>t</sup>*,*<sup>s</sup>*) = *KI*+ (*s*, *t*), we obtain the right-sided integral with upper boundary *T*:

$$y(t) = \, \_{T^{-}}l\_{t}^{\mathfrak{a}}\mathbf{x}(t) := \frac{1}{\Gamma(\mathfrak{a})} \int\_{t}^{T} \frac{\mathbf{x}(\mathbf{s})}{(\mathbf{s} - t)^{1 - \mathfrak{a}}} \,. \tag{64}$$

For *y*(*t*) = 0<sup>+</sup> *Iαt<sup>x</sup>*(*t*), the Euler–Lagrange Equation (48) becomes:

$$\frac{\partial L(t, \mathbf{x}, y)}{\partial \mathbf{x}} + \frac{1}{\Gamma(a)} \int\_{t}^{T} \frac{\partial L(s, \mathbf{x}, y)}{\partial y} \, \frac{1}{(\mathbf{s} - t)^{1 - \alpha}} \, ds = 0 \tag{65}$$

$$\iff \qquad \frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}} + \, \_{T-}l\_{l}^{a} \left( \frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{y}} \right) = \mathbf{0},\tag{66}$$

while in the second case, where *y*(*t*) = *T*− *Iαt<sup>x</sup>*(*t*), we obtain:

$$\frac{\partial L(t, x, y)}{\partial x} + {}\_{0^{+}}I\_{t}^{a} \left( \frac{\partial L(t, x, y)}{\partial y} \right) = 0. \tag{67}$$

We see that, independently of the choice we consider, the Euler–Lagrange equation for the system has both kinds of integrals: left-sided and the right-sided, one as the variable *y*, the other applied to the partial derivative of *L* with respect to *y*. This supposes that the evolution equation at any intermediate time *t* ∈ (0, *<sup>T</sup>*), has elements from both the past and the future.

#### 2.1.6. Fractional Derivatives

**Caputo:** In order to have *y* to represent a fractional derivative, we may consider the dependence on velocities and use in Equation (49) the kernel

$$K\_{\mathbb{C}^+}(t,s) = \frac{1}{\Gamma(1-a)} \frac{\Theta(t-s)}{(t-s)^a}, \quad a \in (0,1). \tag{68}$$

We have that *y*(*t*) is the (left) fractional Caputo derivative of order *α*:

$$\begin{split} y(t) &= \quad \frac{1}{\Gamma(1-\alpha)} \int\_0^T \frac{\Theta(t-s)}{(t-s)^a} \, \dot{\mathbf{x}}(s) \, ds \\ &= \quad \frac{1}{\Gamma(1-\alpha)} \int\_0^t \frac{\dot{\mathbf{x}}(s)}{(t-s)^a} \, ds = \,\_0^\mathbb{C} D\_t^\alpha \mathbf{x}(t) \,. \end{split} \tag{69}$$

The Euler–Lagrange equation is in this case

$$\frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}} - \frac{1}{\Gamma(1 - a)} \frac{\partial}{\partial t} \int\_{t}^{T} \frac{\partial L(s, \mathbf{x}, \mathbf{y})}{\partial \mathbf{y}} \frac{1}{(s - t)^{a}} ds = 0$$

$$\iff \quad \frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}} + {}\_{T}^{RL} D\_{t}^{a} \left( \frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{y}} \right) = 0. \tag{70}$$

Conversely, if we choose in Equation (49) the kernel

$$K\_{\mathbb{C}^-}(t,s) = -K\_{\mathbb{C}^+}(s,t) = \frac{-1}{\Gamma(1-a)} \frac{\Theta(s-t)}{(s-t)^a} \, , \tag{71}$$

we have that *y* is the right Caputo derivative of order *α*

$$y(t) = \frac{-1}{\Gamma(1-a)} \int\_{t}^{T} \frac{\dot{\mathbf{x}}(s)}{(s-t)^{a}} \, ds = \,\_{T}^{C}D\_{t}^{a}\mathbf{x}(t) \,, \tag{72}$$

and the corresponding Euler–Lagrange Equation (53) is now

$$\frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}} + \frac{1}{\Gamma(1 - a)} \frac{\partial}{\partial t} \int\_0^t \frac{\partial L(s, \mathbf{x}, \mathbf{y})}{\partial \mathbf{y}} \frac{1}{(t - s)^a} ds = 0$$

$$\iff \quad \frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}} + {}\_{0+}^{RL} D\_t^a \left( \frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{y}} \right) = 0. \tag{73}$$

We see that for both kernels we have in the Euler–Lagrange equations derivatives form both sides, as in the previous case.

In both circumstances we have an equation that involves values from the past and from the future.

**Example 1.** *<sup>L</sup>*(*<sup>t</sup>*, *x*, *y*) = 12 *y*2 − *<sup>U</sup>*(*x*)*. We have:*

$$\frac{\partial L(t, x, y)}{\partial x} = -\mathcal{U}'(x), \quad \frac{\partial L(t, x, y)}{\partial y} = y'$$

*and the Euler–Lagrange equation is just:*

$$\begin{aligned} \ \_ {T^{-}}^{RL} D\_{t}^{\alpha} \left( \ \_ {0}^{C} D\_{t}^{\alpha} \mathbf{x}(t) \right) &= \mathcal{U}^{\prime}(\mathbf{x}) \\\\ \longleftrightarrow \ \frac{1}{\Gamma^{2}(1-\alpha)} \ \frac{\partial}{\partial t} \ \int\_{t}^{T} \frac{1}{(\mathbf{s}-t)^{\alpha}} \left( \ \int\_{0}^{s} \frac{\mathbf{x}^{\prime}(u)}{(\mathbf{s}-u)^{\alpha}} \, du \right) ds &= -\mathcal{U}^{\prime}(\mathbf{x}), \end{aligned}$$

*if we take the left-derivative for y, and is:*

$$\left( \,\_{0^{+}}^{RL}D\_{t}^{\alpha} \left( \,\_{T^{-}}^{C}D\_{t}^{\alpha} \mathfrak{x}(t) \right) \right) = \mathcal{U}'(\mathfrak{x}),$$

*if we chose the right-derivative. By the way, the sign that seemed to be missing ("the force is* minus *the derivative of the potential") is included inside the right-derivative in both cases, as we have seen right above for one of them.* **Riemann–Liouville:** we have to use the extension of the velocities case and consider in Equation (46) the kernel:

$$K\_{RL^{+}}(t,s) = \frac{1}{\Gamma(1-a)} \frac{\Theta(t-s)}{(t-s)^{a}}, \quad a \in (0,1), \tag{74}$$

since it yields:

$$\dot{y} = \frac{1}{\Gamma(1-a)} \frac{\partial}{\partial t} \int\_0^t \frac{\mathbf{x}(s)}{(t-s)^a} ds = \prescript{RL}{0+} D\_t^a \mathbf{x}(t). \tag{75}$$

The corresponding Euler–Lagrange equation is:

$$\frac{\partial L(t, \mathbf{x}, \dot{\mathbf{y}})}{\partial \mathbf{x}} - \int\_0^T \frac{\partial}{\partial \mathbf{s}} \frac{\partial L(s, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} K\_{RL^+}(s, t) ds = 0$$

$$\iff \quad \frac{\partial L(t, \mathbf{x}, \dot{\mathbf{y}})}{\partial \mathbf{x}} - \frac{1}{\Gamma(1 - \alpha)} \int\_t^T \frac{\partial}{\partial \mathbf{s}} \frac{\partial L(s, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} \frac{1}{(s - t)^a} ds = 0$$

$$\iff \quad \frac{\partial L(t, \mathbf{x}, \dot{\mathbf{y}})}{\partial \mathbf{x}} + \,\_T^C D\_t^a \left( \frac{\partial L(s, \mathbf{x}, \mathbf{y}')}{\partial \mathbf{y}'} \right) = 0. \tag{76}$$

Conversely, if we consider the kernel:

$$K\_{RL^{-}}(t,s) = -K\_{RL^{+}}(s,t) = \frac{-1}{\Gamma(1-a)} \frac{\Theta(s-t)}{(s-t)^{a}}, \quad a \in (0,1), \tag{77}$$

we obtain:

$$\dot{y} = \frac{-1}{\Gamma(1-a)} \frac{\partial}{\partial t} \int\_{t}^{T} \frac{\mathbf{x}(\mathbf{s})}{(\mathbf{s}-t)^{a}} \, d\mathbf{s} = \,^{RL}\_{T} D\_{t}^{a} \mathbf{x}(t), \tag{78}$$

and the Euler–Lagrange equation:

$$\frac{\partial L(t, \mathbf{x}, \dot{y})}{\partial \mathbf{x}} + \, \_0^C D\_t^\mathbf{x} \left( \frac{\partial L(\mathbf{s}, \mathbf{x}, y')}{\partial y'} \right) = \mathbf{0}. \tag{79}$$

As always, we obtain integrals that cover both ranges: from 0 to *t* and from *t* to *T*.

We also see that the result is very similar that for the Caputo derivative, with an exchange of the role of the Caputo and the Riemann–Liouville derivatives.

#### *2.2. Momenta and Hamilton Formalism*

For each variable *y* we may define a momentum associated to it, in analogy to classical mechanics, as

$$p(t) = \frac{\partial L(t, x, y)}{\partial y},\tag{80}$$

or

$$p(t) = \frac{\partial L(t, x, \dot{y})}{\partial \dot{y}}\,' \,' \tag{81}$$

and we can express the previous Euler–Lagrange equations as

$$\frac{\partial L(t, x, y)}{\partial x} + \int\_0^T K(s, t) \, p(s) \, ds = 0,\tag{82}$$

when *y* depends on positions, and when depending on velocities (first case)

$$\frac{\partial L(t, x, y)}{\partial x} - \frac{\partial}{\partial t} \int\_0^T K(s, t) \, p(s) \, ds = 0. \tag{83}$$

or (second case)

$$\frac{\partial L(t, x, \dot{y})}{\partial x} - \int\_0^T K(s, t) \, \frac{\partial p(s)}{\partial s} \, ds = 0 \,. \tag{84}$$

Using the four kernels considered before and the corresponding Euler–Lagrange equations we may give the Hamiltonian approach to the systems.

For instance, when *y* depends on velocities, the momentum is given by Equation (80), we have with kernel Equation (68):

$$\begin{cases} \, \prescript{C}{}{D}\_t^\kappa \mathbf{x}(t) = \mathbf{y}(t),\\ \, \prescript{RL}{}{D}\_t^\kappa p(t) = -\frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}}, \end{cases} \tag{85}$$

and with kernel Equation (71):

$$\begin{cases} \ \ \_ {T}^{\mathbb{C}} D\_t^{\mathfrak{a}} \mathbf{x}(t) = \mathbf{y}(t), \\\ \_ {0}^{RL} D\_t^{\mathfrak{a}} p(t) = -\frac{\partial L(t, \mathbf{x}, \mathbf{y})}{\partial \mathbf{x}}. \end{cases} \tag{86}$$

When *y* depends on positions, the Lagrangian depends on *y*˙ and the momentum is Equation (81), we obtain with kernel Equation (74):

$$\begin{cases} \begin{aligned} \, \_{0^{+}}^{RL}D\_{t}^{a}x(t) = \dot{y}(t), \\ \, \_{T^{-}}^{C}D\_{t}^{a}p(t) = -\frac{\partial L(t,x,\dot{y})}{\partial x}, \end{aligned} \end{cases} \tag{87}$$

and with kernel (77):

$$\begin{cases} \begin{array}{c} \prescript{RL}{T}{D}\_t^a \mathbf{x}(t) = \dot{\mathbf{y}}(t), \\\\ \prescript{C}{}{D}\_t^a p(t) = -\frac{\partial L(t, \mathbf{x}, \dot{\mathbf{y}})}{\partial \mathbf{x}}. \end{array} \tag{88}$$

Whenever from Equation (80) we can express *y* (or *y*˙) as a function of *x* and *p*, i.e., we can provide a Legendre transformation, the previous systems of equations correspond to the Hamilton equations.

As for the general case presented in Section 2.1.4, we may consider several functions *y* in the Lagrangian, and each will give rise to its corresponding momentum and a corresponding evolution equation for it.
