A Variational method from the variance of energy