The calculus of variations in the large