On some integral inequalities and their applications to the Calculus of Variations