Text this: Capture of electrons for acceleration in a betatron with time and spatial variation of the magnetic field