Title: Theory of x-ray diffraction in crystals