A new algebraic inequality and its application