Theory of X-Ray Diffraction by a Vibrating Crystal