Lagrange's equation for continua