Like most people above, I am not really sure what you are doing with this information. However, after you have looked at the continuous case, you might consider looking at the discrete calculus of variations. [1] (listed below) has a very nice chapter (chapter 8) on the discrete calculus of variations.
[1] Kelley, W. & Peterson, A. (2001). Difference Equations: An Introduction with Applications (2nd Ed.). San Diego, CA: Academic Press.