Integral formulas, inequalities and their applications in Riemannian manifolds