A Theoretical Study of the Diffuse Scattering of X-Rays by Crystals