Calculating the linear response functions of noninteracting electrons with a time-dependent Schrödinger equation