The calculation of multiphonon X-ray scattering