Analytical approach to the impurity scattering in quantum wells