If a semiconductor is heated such that there is no temperature gradient, is it under thermal equilibrium? I have studied that if no temperature gradient exists across a semiconductor then it's in thermal equilibrium but what if there isn't a temperature gradient across it? Still, the semiconductor would be absorbing heat and its temperature be risen. In order for thermal equilibrium to be there, semiconductor should give out all the heat it's absorbing. How would this happen? And also, please tell if something else happens.
Before the heater is turned on the system is in equilibrium with the environment. It's temperature does not change over time because the total energy absorbed from the environment and emitted to the environment is equal.
When the heater is activated, and after some time, the semiconductor will reach a stable temperature when the total energy absorbed from the heater and the environment equals the total energy emitted back to the heater and to the environment. The semiconductor is again in an equilibrium state. Moreover you can fully described the system thermodynamical by its constant temperature.
When the heater is turned off, the system will release more energy than it gains from the environment and it's temperature will decrease until the energy streams again become equal. Equilibrium.
There are 3 forms of heat exchange: conduction, convection and radiation. In your example, I would say heat enters through conduction via physical contact with a heating element and exits via all three.