We report the resonant enhancement of the second- and third-order optical nonlinearities in compositionally asymmetric quantum wells with finite confining potential and interdiffused quantum wells. The energy levels and the envelope wave functions in quantum wells are obtained by solving numerically the Schrodinger equation. The optical rectification, second and third harmonic generation coefficients are calculated within the framework of the density matrix formalism. The effect of the structure parameters such as the well width and the barrier height on the nonlinear optical properties is investigated in detail. The resulting nonlinear susceptibilities obtained in both quantum wells are considerably larger than those of bulk GaAs. (C) 2008 American Institute of Physics.