Fermat’s Principle and Hamilton’s Principle: Does a least action take a least time for happening?

We explore deeper and analyse in more detail Fermat’s and Hamilton’s principles. We try to address some questions: Is it possible to have S negative? Is Hamilton’s principle always valid for entire path of the system? Is there a relation between Fermat’s principle and Hamilton’s principle? We assume analogy with Hamilton’s principle, is Fermat’s principle always valid for entire path of the system? Does a least action take a least time for happening?.


Fermat's Principle
Nature behaves lazy, a minimum effort [1,2]. The minimum principle was encontered for the first time in optics. Pierre de Fermat (1601-1665) postulated that, no matter to what kind of reflection or refraction a ray is subjected. Probably Abu Ali al-Hassan ibn al-Haytham/Alhacen (965-1040), the writer of Kitab al-Manathir/Book of Optics, is the first one who expresses an early version of the principle of least time and expand this principle to both reflection and refraction [3]. It travels from one point, r1, to another, r2, in such a way as to make the time taken a minimum [4,5,6]. In rare cases, it can be maximum [6,7,8,9]. Or, in more accurate statement: it is stationary [10,12]. Fermat extended what Hero of Alexandria (10 AD -70 AD) had discovered a similar law for the particular case where the ray of light is reflected by a mirror [4,13]. Refer to Hero, the light travels in such a way that is goes to the mirror and to the other point in the shortest possible distance. It was this that inspired Fermat to suggest to himself that perhaps refraction operated on a similar basis. But for refraction, light obviously does not use the path of shortest distance, so Fermat tried the idea that it takes the shortest time [14].
Mathematically, Fermat's principle can be written as [10]. = ∫ 2 1 = (1) The points r1 and r2 are two fixed points in space [6]. In general, being stationary (being a minimum, maximum or inflection) is a property of a functional (that is, a function of one or more functions). It does not mean physically that light travels through a minimum, maximum or inflection point, although one could loosely say that light travels along the minimizing path, maximizing path or inflection path.

Hamilton's Principle
Hamilton's principle (1834) or principle of least action can be stated as: the motion of the system from fixed time t1 to fixed time t2 is such that the line integral (called the action or the action integral) [15].
where S is a functional of the function or path x(t), ℒ is a Lagrangian system and ( ) = = , has a stationary value for the actual path of the motion. Or = 0 (3) notation means variation, i.e. virtual and infinitesimal change [13].
= 0 is a necessary condition for S to have a minimum value. This means that = 0 can be because of S has a maximum value or inflection.
The point of Hamilton's principle is that it identifies paths x = x0(t) that satisfy certain sets of differential equations with the paths that minimize a particular functional S. Because, all possible paths "near" the actual path x = x0(t) must give values for S that are larger than the value given by x = x0(t). That is, the action on nearby paths must be larger than the action on the actual path.
When minimizing the action, the limits on the integral are fixed points in both space and time: (r1; t1) and (r2; t2). The velocity = | 2 − 1 |/| 2 − 1 | on the actual path (which we know must have constant velocity), is also fixed, and the value of the action on the actual path is A path that is close to the actual path ( ) = 1 + ( 2 − 1 ) would have the form ( ) = 1 + ( 2 − 1 ) + ( ) (5) Where a is any function satisfying ( 1 ) = ( 2 ) = 0, and k is a small parameter. So ( , ) = 0 + 2 (7) As ( 2 ) = ( 1 ) = 0. This means that and the action is a minimum on the actual path, as required.
Is it possible to have e.g. a negative value, instead 0, for ? If we can find a nearby path x = x0(t) + x(t) which has negative, then S has a smaller value on this new path than it does on the original path, x = x 0 (t). So, S obviously does not have a minimum value on x = x 0 (t). Hamilton's principle identifies solutions of the equation of motion with paths that minimize S. If the path x = x0(t) does not minimize S (meaning that is negative for some nearby path) then the path x = x0(t) does not satisfy the equation of motion. So, it is not possible to have a negative value for , instead 0, for S to have a minimum value.

Is Hamilton's Principle always valid for entire path of the system?
Hamilton's principle is not always valid for entire path of the system, but only for any sufficiently short segment of the path [16]. This is because there do exist mechanical systems, usually with periodic or oscillating behaviour, which have the property that the solutions (to the equation of motion) do not necessarily minimize the action S if they extend beyond half an oscillation period. An example of this is simple harmonic motion of a oscillator. Suppose that Lagrangian system is  (10), we obtain the equation of motion of the oscillator 2 2 + = 0 (11) The solution of the equation of motion of the oscillator is [10,11] ( ) = cos + sin (12) Where A and B are constants.
Suppose we want to use Hamilton's principle to find the path with boundary conditions (0) = 0 and ( ) = 1, where T > 0. The solution of the equation of motion with these boundary conditions has A = 0 and B = 1= sin T. The value of the action is = ∫ ( 2 cos 2 − 2 sin 2 ) = 2 sin cos = cot 0 (13) It turns out that cot T is the minimum possible value for S provided that < (and is half the period of the oscillator, which is 2 ). Note that cot → −∞ as → from below, but cot → +∞ as → from above. That is, cot T jumps from −∞ to +∞ at = , and so it is unlikely to minimize S for > . If
In the case of Fermat's principle, the (functional) transit time can be stated as  , (because c is constant), which means that the light ray will trace out a straight line in vacuum space. In the case of Hamilton's principle, the action of a single particle with mass, m, in a vacuum (no interaction) is   where the limits on the integral are now the initial and final fixed times, t1 and t2, and it is understood that r1 = r(t1) and r2 = r(t2). In vacuum, this action is minimized because there is no potential energy or interaction. We can state that The two solutions, (22), (25), are obviously equivalent if | | = , but many other velocities are possible in the least action case. This means that Fermat's principle applies only to light rays in the geometrical optics limit and assumes that the velocity of light (or equivalently the refractive index relative to the vacuum) is known at all points in space-time. Hamilton's principle applies to both particles and field, and it assumes nothing about speeds of propagation. It just requires a knowledge of kinetic and potential energies of the particle or field. In the simplest case, i.e. motion in a vacuum space-time, the two principles do give the same solution: motion in a straight line.
We see from Table 1 and Table 2 that Fermat's principle takes a stationary value for a function of a length coordinate and Hamilton's principle takes a stationary value for functions of time. Or, Fermat's principle takes a minimum value for the transit time with the endpoints, r1, r2, fixed in space, whereas Hamilton's principle takes a minimum value for the action with the endpoints, (r1, t1), (r2, t2) fixed in both space and time.
Using the same argument for Hamilton's principle which we stated earlier, Fermat's principle is valid only for a sufficiently short segment of the path. A "path" in both cases (Hamilton and Fermat) is a parametric representation of the position of the particle in space: (x; y; z) = (X(s); Y (s); Z(s)), where s is some parameter. In both principles the end points of the position of the particle in space, r1, r2, are fixed. Because the start time and the finish time in Hamilton's principle are also fixed, so we can use t in place of the parameter s. But in Fermat's principle, the transit time is what is being minimized, so the finish time is not fixed, and it is often more convenient to use, say, z as the parameter s. Then (x; y; z) = [X(s); Y (s); z], and Fermat's principle turns into the integral of a Lagrangian function, as we saw in Table 1.

Does a least action take a least time for happening?
The initial and final fixed times, t1 and t2, are assumed to be given in a least action problem. So, the transit time cannot be minimised: it has a fixed value 2 − 1 . Even if we were to consider a slightly di erent type of problem, where r1 and r2 are fixed, but the transit time is not fixed, and we are asked to calculate the total action, S, for particles travelling from r1 to r2 in a straight line (vacuum) at all possible speeds, V , it is not true that the smallest time will correspond to the smallest value of S. In fact, in terms of V, we must have

What is the relevance of Fermat's and Hamilton's principles with the frontier of applied physics?
The main contribution of Fermat's and Hamilton's principles is they led to development of calculus of variations. Mathematically, we speak of an extremum problem whenever the largest or smallest possible value of a quantity is involved. For the solution of finding such an extremum (maximum/minimum) problem of a definite integral, a special branch of mathematics, called the calculus of variations, has been developed [13].
In optimal control theory, Lev Pontryagin developed the relationship between the theory of optimal processes and the classical calculus of variations. He showed that the optimal problem is a generalization of the problem of Lagrange in the calculus of variations [21]. In dynamic programming, Richard Bellman developed the functional-equation technique to provide a new approach to some classical problems in the calculus of variations [22]. Some examples of "practical" application of Fermat's and Hamilton's principles can be found here [23,24,25,26].

Conclusions
Mathematically, Fermat's principle is equivalent with Hamilton's principle. Fermat's principle minimizes the transit time with the limits on the integral are fixed points in space: r 1 , r 2 , whereas Hamilton's principle minimizes the action with the limits on the integral are fixed points in both space and time: (r1, t1), (r2, t2).
Fermat's and Hamilton's principles are not always valid for entire path of the system, but only for any sufficiently short segment of the path. In the simplest case, i.e. motion in a vacuum space-time, the two principles do give the same solution: motion in a straight line, since a straight line is the shortest connection between any two points. The main contribution of Fermat's and Hamilton's principles is they led to development of calculus of variations. Nature behaves stationary, it takes biggest time for smallest action.