Derivation from coupled channel equations of the resonance raman scattering amplitude for a diatomic molecule