Required reading:
Moore and Reynolds, Pages 77-103
Brindley and Brown, pages
128-135, 225-261
Theoretical treatment of X-ray Diffraction
It is possible to calculate the diffraction pattern (i.e.,
coherent interference pattern) for any given crystal structure given:
Scattering effects
Atoms scatter radiation (with a wavelength equal to that of incident radiation) in all directions (like a beacon). The efficiency (f) is the result of scattering from individual electrons.
f = Amplitude of a wave scattered by atom / Amplitude of wave scattered by an electron
Scattering efficiency is also controlled by direction of
scattering. The figure below shows the phase shift that results
from scattering from two different regions of the electron cloud.

As a consequence, f decreases
with increasing angle of reflection. The figure below shows the change
in f for commonly encountered
ions in clay minerals. The atomic scattering factor values are plotted as a function of
°2θ. The plot below is for Cu Kα radiation. Click here for an Excel spreadsheet
that allows you to change the wavelength of radiation (data from
Cullity, 1978).

Recall that rows of atoms cause scatter in specific directions
resulting in constructive interference (i.e., coherent scatter).
For the case of clay minerals, the approach is greatly simplified.
The morphological nature of clay minerals is such that they can
easily be prepared to orient their crystallographic axes (the ab
plane) relative to the X-ray beam. This is called "preferred
orientation" (as opposed to random orientation).
We now want to describe this diffraction effect from a unit
cell in a crystal. If the clays are oriented, then we can
consider this to be a one-dimensional diffraction problem.
The scattering from a unit cell (F)
is always less than the total sum of atoms in the unit cell because
the rays that the atoms scatter are out of phase with each other.
F is call the structure factor and is therefore,
a measure of the intensity of the diffracted X-ray beam.
To find F, the sum of the amplitudes of each atom in
the unit cell must be determined.
The sum of amplitudes must be adjusted by the amount of phase
difference due to the location of the atoms in the unit cell.
Recall that the phase difference is related to (1) the wavelength,
(2) the angle of incidence, (3) the position of the atom planes
and (4) the number and type of atoms in each plane. An example
is given the figure below.

If d is equal to the c lattice parameter, and x/c is the fractional coordinate w (recall also that (uvw) are the fractional coodinates for any position within a 3-D unit cell), then the phase shift expression becomes
φ = 2 π l w
For the 3-D case of (hkl)
Phase differences between the scattered waves (all with
the same wavelength) can be determined mathematically by a structure
factor function where:
where:
We use the identity:
to yield
If there is a center of symmetry in the unit cell and the origin
for the calculation can be placed at that point then the sine
series goes to zero and the complex number is eliminated. This
elimination is not essential to the theoretical development of
the structure factor. It's just being elminated here to help streamline
the example and simplify the calculations.
Therefore the above equation becomes,
We can expand the phase of the wave (φn)
by letting
where:
let:
The fact that F can be negative or positive is not
detectable
in the X-ray experiment. The only thing that we measure with a
detector is the intensity or magnitude. Therefore, squaring F
eliminates its sign. What the detectors sees then is |F|2
.
F is a discontinuous function (i.e., it is defined
by the integer l).
In order to consider the structure factor over a range of angular
space (i.e., make it a continuous function) we return to
Bragg's Law.
let:
solve in terms of l
by substitution:
Where:
Under ideal conditions all the diffraction takes place at the
Bragg angles of reflection.
Diffraction effects (in one dimension) due to scattering from a grating can be described by an interference function:

where:
If N = 1 then Φ = 1 at all angles. Bragg reflection cannot occur from a single scattering center.
If N = 100, then Φ (at the ideal Bragg angle) is large. At the same time φ is small away from the Bragg angle. In other words the peaks are very intense and narrow.
The example below are graphical solutions to the interference function using values of 8° 2θ, λ = 1.54049 Å and various values of N.

Lorentz-Polarization factors (Lp)
Polarization factor (p)-
The X-ray beam that exits the tube is unpolarized (analagous to
light coming from the sun). Low angle scattering causes
polarization of the beam (analgous to light reflecting off a lake). The polarization factor accounts for increase scattering
at low angles. Various workers have conducted experiments and fit their
results to theory and found the scattering intensity (Ip) due to polarization
is
proportional to (1 + cos2 θ)/2. This is taken from
theoretical study and is
known as the Thomson equation for scattering of an X-ray beam from a
single electron.
Lorentz factor (L)- The X-ray beam that exits the tube is also not strictly monochromatic nor parallel (some divergence occurs). These factors in combination with motion of the crystal (as noted by Klug and Alexander) contribute to a planes "opportunity" to reflect (i.e, planes that make an angle with the rotation axis are in a reflecting position longer than those parallel to the axis, hence disproptionate intensities will be observed). The Lorentz factor is related to the volume of sample irradiated as a function of angle.
The number of crystals exposed to the beam is also a factor.
Therefore we need to consider scattered beams from random powders
differently from single crystals. The single crystal form of the
Lorentz factor is sin 2&theta. The
random powder form of the Lorentz factor is (sin θ sin 2θ).
We will see later, that from a practical standpoint it is almost
impossible to achieve a perfectly oriented sample or a complete
randomly oriented sample. The approach will be to use some mixture or
blending of the single crystal form and the powder ring distribution
factor (ψ). Lp = (1 +
cos2 θ) ψ
/ (sin θ). For random powders ψ is
propotional to 1/(sin θ). For a single crystal ψ is constant. The
development of this
theory is given by Reynolds (1986).

If you really want to know a lot more about L-P factors, then seek the reference below.
Reynolds R. C. (1986) The lorentz-polarization factor and preferred oreinetation in oriented clay aggregates: Clays and Clay Minerals 34(4), 359-367.
Effect of scattering domain size and defects
A characteristic of clay minerals is that size of their coherent
scattering domains is typically small and there are
imperfections
or stacking defects between adjacent domains (i.e. N is small).
The result of numerous stacking faults or small domain sizes
is known as particle size broadening and can be inferred from
the peak widths (as seen in the interference function above).
Peak widths are measures by their Full Widths at Maximum Half-height
(FWMH).
Under certain conditions the FWMH can be used to estimate the
distribution of particle sizes (domain sizes, not particle diameters).
This is expressed by the Scherrer Equation which assumes all
reflections along a line normal to the reflecting plane.
where:
Example:
let:
then:
L = (1.54059 x 1 ) / [(0.1 x 3.14 / 180) x cos (13.3°)]
= 1300Å