A novel numerical method for infinite domain potential problems