On the lower semicontinuity of certain integrals of the calculus of variations