ELLIPTIC COMPLEXES IN THE CALCULUS OF VARIATIONS