text: Using non-linear least squares minimization, the following system is solved:
  where is the calculated intensity and is the observed intensity of a point  in the powder pattern, , is a scale factor, and  is the number of measured data points. The minimized function is given by:
  where is the weight, and from the previous equation is unity (since  is usually absorbed in the phase scale factor). The summation extends to all  data points. Considering the peak shape functions and accounting for the overlapping of Bragg peaks because of the one-dimensionality of XRD data, the expanded form of the above equation for the case of a single phase measured with a single wavelength becomes:
  where:
  *  is the background at the  data point.
  *  is the phase scale factor.
  *  is the number of Bragg reflections contributing to the intensity of the   reflection.
  *  is the integrated intensity of the  Bragg peak.
  *  is the peak shape function.
  For a material that contains several phases (), the contribution from each is accounted for by modifying the above equation as follows:
  It can easily be seen from the above equations that experimentally minimizing the background, which holds no useful structural information, is paramount for a successful profile fitting. For a low background, the functions are defined by contributions from the integrated intensities and peak shape parameters. But with a high background, the function being minimized depends on the adequacy of the background and not integrated intensities or peak shapes. Thus, a structure refinement cannot adequately yield structural information in the presence of a large background.
  It is also worth noting the increased complexity brought forth by the presence of multiple phases. Each additional phase adds to the fitting, more Bragg peaks, and another scale factor tied to corresponding structural parameters, and peak shape. Mathematically they are easily accounted for, but practically, due to the finite accuracy and limited resolution of experimental data, each new phase can lower the quality and stability of the refinement. It is advantageous to use single phase materials when interested in finding precise structural parameters of a material. However, since the scale factors of each phase are determined independently, Rietveld refinement of multi phase materials can quantitatively examine the mixing ratio of each phase in the material.