Analytic and numerical analysis of the cosmic 21cm signal