To demonstrate how to use the Euler-Lagrange equation in classical mechanics, we solve brachistochrone problem as an example. The problem is described in the blackboard shot, which is to find the path of a particle that minimizes the time traveled from point to point in a uniform gravitational field. In this situation, we assume there is no friction along the path; thus the energy is conserved. Let be the vertical coordinate. Then, by the conservation of energy, we have
Thus, we have
Then, the time may be described as
where is the infinitesimal arclength of the path. Then, let be the horizontal coordinate, we have Thus, the above equation would be
Now, let , we apply the Euler-Lagrange equation and obtain
If we rearrange the equation and integrate, we obtain the equation
where is some constant. Then, we rearrange the equation and obatin
Then, we can solve this equation with parameterization and obtain the final result