Well-posedness of nonconvex integral functionals