The numerical analysis of spectral methods when non-constant coefficients appear in the equation, either due to the original statement of the equations or to take into account the deformed geometry, is presented. Particular attention is devoted to the optimality of the discretization even for low values of the discretization parameter. The effect of some overintegration is also addressed, in order to possibly improve the accuracy of the discretization.