1. Introduction
Fractional calculus is as old as ordinary calculus, but it was only at the end of the 20th Century that it managed to attract the attention of many researchers, who in their studies showed that this theory is an important tool to model problems, not only in mathematics, but also in other areas, such as physics, engineering, chemistry, biology, epidemiology, and control theory, among others (see [
1,
2,
3,
4,
5,
6]). Many important mathematicians such as Euler, Lagrange, Fourier, Abel, Liouville, and Riemann worked in fractional calculus. Fractional derivatives and fractional integrals are generalizations of the notions of integer-order derivatives and integrals and include 
n-th derivatives and 
n-fold integrals as special cases. Several different fractional derivatives have been defined, such as Riemann–Liouville, Caputo, Riesz, Erdelyi–Kober, and Hadamard, just to mention a few [
7,
8]. We note that each definition has its own properties and that many of them are not equivalent to each other. In this paper, we deal with the general notions of distributed-order fractional derivatives with respect to an arbitrary kernel in the Riemann–Liouville and Caputo sense, recently introduced in [
9]. One of the advantages of fractional derivatives is that these operators are non-local, thus conserving system memories, as opposed to integer-order derivatives, which are local operators.
The calculus of variations deals with the optimization of functionals involving an integral in which the Lagrangian depends on the independent variable, an unknown function, and its derivative (or derivatives). The classical problem of the calculus of variations was generalized by G. Herglotz in 1930 [
10], who presented a new problem involving a first-order initial-value problem that defines a function 
 in a given interval 
 and consists of finding trajectories 
x and 
z that extremize the 
 value. This problem is also known as a generalized variational problem. One of the advantages of this problem is that it allows giving a variational description of non-conservative and dissipative processes, even when the Lagrangian is autonomous [
11], which is not possible using the classical variational calculus. Herglotz’s problem only attracted the attention of the scientific community in the late Twentieth Century. Thereafter, many important results of the classical calculus of variations were then generalized to Herglotz problems [
11,
12,
13,
14,
15,
16].
The fractional calculus of variations generalizes the classical variational calculus, replacing the integer-order derivatives by fractional derivatives in the Lagrangian function given in the integral of the functional to be extremized. It was in 1996 that the fractional calculus of variations had a considerable development, being relevant to better describe non-conservative systems in mechanics. Furthermore, this theory provides a more realistic approach to physics, allowing it to consider non-conservative systems in a more natural way [
6,
17]. Since then, this theory has attracted much attention from a large number of researchers, with several articles published [
12,
18,
19,
20,
21,
22,
23].
In [
9], the authors introduced a new fractional operator, combining two fractional operators: fractional derivatives of distributed-order and fractional derivatives with respect to another function. The order of this new fractional derivative is not constant, and this operator is defined using a function of probability, which acts as a distribution of orders of differentiation, multiplied by a fractional derivative. Our objective in this paper is to study several Herglotz-type problems involving this new fractional derivative.
This paper is organized as follows. In 
Section 2, we present the classical Herglotz variational problem and some necessary background on fractional calculus. In 
Section 3, we study the fractional Herglotz problem, in four different cases, using distributed-order fractional derivatives with arbitrary kernels. Namely, we study fractional variational problems of the Herglotz-type for the case where the orders of differentiation belong to the interval 
, for the higher-order case, for problems involving time delay, and with several independent variables. Finally, we present some examples to illustrate our main results.
  3. Main Results
In this section, we study four different types of variational problems of the Herglotz type involving distributed-order fractional derivatives with arbitrary smooth kernels.
  3.1.  Herglotz Fractional Variational Problem—Case 1
For this problem, we restrict ourselves to the case where 
, that is considering the definitions introduced in [
9].
Consider two continuous functions 
 satisfying the following conditions:
In what follows, we use the notation:
        and we denote the partial derivative of 
L with respect to its 
ith-coordinate by 
.
We can formulate the problem as follows:
Problem  : Determine trajectories 
 and 
 that extremize (minimize or maximize)
        
        where the pair 
 satisfies the differential equation:
        and
        
 It is assumed that 
 and 
 are of class 
, 
 is of class 
, and the maps exist and are continuous on 
:
        for all admissible pairs 
, where
        
The following result gives a necessary condition of the Euler–Lagrange type and natural boundary conditions, for an admissible pair  to be a solution of the problem .
Theorem 2. (Necessary optimality conditions for Problem ) If the pair  is a solution of Problem , then  satisfies the generalized fractional Euler–Lagrange equation:for all . Furthermore, if  is free, then  satisfies the following condition:and if  is free, then  satisfies the following condition:  Proof.  Suppose that the pair 
 is a solution of Problem 
 and 
 is an arbitrary function, such that its Caputo distributed-order fractional derivatives, 
 and 
, are continuously differentiable. Define the function 
 by
          
Since 
 is fixed, we have that 
. Now, we define 
, where 
, by
          
We have that zero is a local extremizer of 
g, since 
 is a local extremum, and therefore,
          
Solving this equation, we obtain
          
Considering 
, we obtain
          
Using fractional integration by parts (Theorem 1) in Equation (
5), we obtain
          
Considering 
 in Equation (
6), we have
          
From the fundamental lemma of the calculus of variations (see [
24]), we obtain
          
          for all 
, proving the generalized fractional Euler–Lagrange Equation (
2). Since 
 is arbitrary if 
 is free, using (
2) and considering 
 and 
 in (
6), we obtain
          
          proving the natural boundary condition (
3). Similarly, since 
 is arbitrary if 
 is free, considering 
 and 
 in (
6) and using (
2), we obtain the natural boundary condition (
4).    □
 Remark 1. We note that if the Lagrangian L does not depend on z, then we obtain as a corollary Theorem 3.2 of [9].    3.2. Herglotz Fractional Variational Problem—Case 2
For this problem, let us consider the case where the Lagrangian depends on higher-order distributed-order fractional derivatives (see Definition 2).
Consider the distribution functions 
 with domains 
, 
, where 
 is fixed, satisfying the following conditions
        
For the simplicity of notation, we consider the following:
Problem  : Determine trajectories 
 and 
 that extremize
        
        where 
 satisfies the differential equation:
        subject to the boundary condition:
 We assume that, for each 
, 
 and 
 are all of class 
, the Lagrangian function 
 is of class 
, and the maps exist and are continuous on 
:
        for all admissible pairs 
, where
        
We are now in a position to present our second result.
Theorem 3. (Necessary optimality conditions for Problem ) If the pair  is a solution of Problem , then  satisfies the generalized fractional Euler–Lagrange equation:for all . Furthermore, - (i) 
 For a given , if  is free, then - (ii) 
 For a given , if  is free, then 
 Proof.  Let 
 be an arbitrary function such that 
, if 
 or 
 are fixed, respectively, for each 
. Defining 
 by
          
          then 
, 
, and
          
The solution of Equation (
12) is defined by
          
Considering 
 and taking 
 in (
13), Theorem 1 allows us to prove that
          
Since
          
          from the arbitrariness of 
h and using the fundamental lemma of calculus of variations, we have proven the generalized fractional Euler–Lagrange Equation (
9) and the necessary conditions (
10) and (
11).    □
 Remark 2. It is easy to see that Theorem 9 of [25] is a corollary of Theorem 3.    3.3.  Herglotz Fractional Variational Problem—Case 3
It is well known that time delay is a common phenomenon that occurs in many engineering and nature problems. Therefore, it is extremely important to consider when formulating such problems the explicit dependence of a time delay, in order to better understand the evolution of the dynamical systems under observation. Motivated by the importance of considering a time delay in the formulation of variational problems, we now study the Herglotz variational problem with time delay. For the simplicity of presentation, we restrict ourselves to the case where .
In what follows, 
 is a fixed real number such that 
, and in order to simplify the notation, we write:
Problem  : Determine 
 and 
 that extremize
        
        where
        
 and 
 on 
, where 
 is a given initial function.
 It is assumed that  and  are of class  and L satisfies the following conditions:
The next result presents the necessary optimality conditions for the fractional variational problem of the Herglotz type with time delay. 
Theorem 4 (Necessary optimality conditions for Problem 
). 
If the pair  is a solution of Problem , then  satisfies the generalized fractional Euler–Lagrange equations:andFurthermore, if  is free, then  satisfies the natural boundary condition:  Proof.  Let 
 be an arbitrary function such that 
, 
, and 
 are of class 
. Defining function 
 by
          
          we have that 
. Hence, we obtain
          
Solving the differential Equation (
17), we obtain
          
Considering 
 and replacing 
 in (
18), we have
          
Since
          
          then, from (
19), we obtain
          
Note also that
          
          for all 
, and
          
          for all 
. Using Equation (
21) and Theorem 1, we conclude that
          
Similarly, using (
22) and Theorem 1, we obtain
          
Therefore, we obtain
          
          introducing (
23) and (
24) into (
20). Therefore, choosing the appropriate 
h and using the fundamental lemma of calculus of variations, we obtain the generalized fractional Euler–Lagrange Equations (
14) and (
15) and the natural boundary condition (
16).    □
 Remark 3. It is clear that Theorem 2 of [25] can be obtained from Theorem 4 in the particular case where the Lagrangian is independent of z.    3.4. Herglotz Fractional Variational Problem—Case 4
For this the last problem, we consider the case where the state function depends on several independent variables. Here, we have the case where the fractional orders belong to the interval .
We consider 
 and 
. We denote by 
 the time variable and 
 the spacial coordinates. We use the notation:
        where
        
        and
        
        and 
 and 
 denote the left and right partial distributed-order fractional derivatives of 
x with respect to the variable 
t; 
 and 
, for any 
, denote the left and right partial distributed-order fractional derivatives of 
x with respect to the variable 
. Furthermore, it is assumed that the domain of function 
 contains the intervals 
 and 
, for 
.
Problem  : Determine trajectories 
 and 
 that extremize
        
        such that the pair 
 satisfies the differential equation:
        and
        
 Furthermore, we assume that 
 is fixed when 
 and 
, for all 
. We suppose that 
, 
, 
, and 
 are of class 
 for 
, 
 is a continuously differentiable function, and the maps exist and are continuous on 
U:
        and
        
        for all admissible pairs 
 and for all 
, where
        
Under these assumptions, we can prove our last result.
Theorem 5 (Necessary optimality conditions for Problem 
). 
If the pair  is a solution of Problem , then  satisfies the generalized fractional Euler–Lagrange equation:for all . Furthermore, if  is free, thenand if  is free, then Proof.  Let  be an arbitrary function such that its Caputo distributed-order fractional derivatives are continuously differentiable. Because the state function is fixed when  and , we suppose that, for any , if  or , then  for all . Defining function  by
          then 
 and
          
          we obtain
          
Using Theorem 1, we obtain
          
From the arbitrariness of 
h and using the fundamental lemma of the calculus of variations, we obtain the generalized fractional Euler–Lagrange Equation (
25) and the natural boundary conditions (
26) and (
27).    □
   5. Concluding Remarks
In this paper, we studied four cases of the fractional-Herglotz-variational-type problems, where the Lagrangian depends on distributed-order fractional derivatives with arbitrary smooth kernels. In the first case, the distributed order belongs to 
, by considering the definitions introduced in [
9]. In the second case, we considered the higher-order case, that is when 
 for a given 
, considering the definitions recently introduced in [
25]. In the third case, we studied the Herglotz variational problem with time delay, and in the last case, we considered the Herglotz variational problem with several independent variables. We proved the necessary optimality conditions for all of these Herglotz-type problems, and three examples were presented to illustrate our results. To finalize this paper, we point out that our theoretical contributions generalize several results recently proven in the context of the fractional calculus of variations.