Spectral sequences and the inverse problem of the calculus of variations