We consider the demixing of diblock copolymers grafted densely to a su
rface in the melt state using mean-field methods. The layer contains e
qual numbers of A-B and complementary B-A chains. The incipient demixi
ng leads to a density wave of composition, produced by splaying of the
chains. In an equal mixture of A-C and B-C copolymers where only the
free ends are immiscible, phase separation takes place in a thin zone
near the free surface of the layer. Because the free end density is si
ngular at the free surface, the AB interaction strength required for d
emixing scales linearly with the length of the terminal A and B blocks
, rather than quadratically, which would be the case for demixing of a
blend of the same copolymers.