We study the polarization anisotropy in the cosmic microwave background (CM
B) resulting from patchy reionization of the intergalactic medium by stars
in galaxies. It is well known that the polarization of the CMB is very sens
itive to the details of reionization, including the reionization epoch and
the density fluctuations in the ionized gas. We calculate the effects of re
ionization by combining a semianalytic model of galaxy formation, which pre
dicts the redshifts and luminosities of the ionizing sources, with a high-r
esolution N-body simulation, to predict the spatial distribution of the ion
ized gas. The models predict reionization at redshifts z similar to 5-10, w
ith electron scattering optical depths due to reionization of similar to0.0
14-0.05. We find that reionization generates a peak in the polarization spe
ctrum with amplitude similar to0.05-0.15 muK at large angular scales (l sim
ilar to 3). The position of this peak reveals the size of the horizon at re
ionization, whilst its amplitude is a measure of the optical depth to reion
ization. On small scales (l greater than or similar to 6000), reionization
produces a second-order polarization signal due to the coupling of fluctuat
ions in the free electron density with the quadrupole moment of the tempera
ture anisotropy. Careful study reveals that this coupling generates equal s
econd-order polarization power spectra for the electric and magnetic modes,
with amplitude similar to 10 nK. This amplitude depends strongly on the to
tal baryon density Omega (b) and on the spatial correlations of the free el
ectron density, and weakly on the fraction f(esc) of ionizing photons able
to escape their source galaxy. The first- and second-order signals are ther
efore sensitive to different details of how the reionization occurred. Dete
ction of these signals will place important constraints on the reionization
history of the universe.