Introduction to the Variational Calculus