Integral representation of functionals defined on Sobolev spaces