A theory of dynamic and steady responses in chemoreception