Recently the unified method for finding traveling wave solutions of nonlinear evolution equations was proposed by one of the authors (HIAG). It was shown that, this method unifies all the methods being used to find these solutions. In this paper, we extend this method to find a class of formal exact solutions to Korteweg–de Vries equation with space dependent coefficients.