Theory of optical hysteresis for TE guided modes