  We present a general scheme for the computation of the time dependent (TD)
quadratic susceptibility ($\chi^{(2)}$) of an extended insulator obtained by
applying the `$2n+1$' theorem to the action functional as defined in TD density
functional theory. The resulting expression for $\chi^{(2)}$ includes
self-consistent local-field effects, and is a simple function of the linear
response of the system. We compute the static $\chi^{(2)}$ of nine III-V and
five II-VI semiconductors using the local density approximation(LDA) obtaining
good agreement with experiment. For GaP we also evaluate the TD $\chi^{(2)}$
for second harmonic generation using TD-LDA.
