The hatched areas in the figure represent the amount of solute in the solid and liquid.  Considering that the total amount of solute in the system must be conserved, the areas are set equal as follows:
Since the partition coefficient (related to solute distribution) is
: (determined from the phase diagram)
and mass must be conserved
the mass balance may be rewritten as
Using the boundary condition
: at 
the following integration may be performed:
Integrating results in the Scheil-Gulliver equation for composition of the liquid during solidification:
or for the composition of the solid: