A dual method to the collocation method