Collocation and Variational method for boundary value problems