|Thermoregulation in animals|
An endotherm (from Greek ἔνδον endon "within" and θέρμη thermē "heat") is an organism that maintains its body at a metabolically favorable temperature, largely by the use of heat released by its internal bodily functions instead of relying almost purely on ambient heat. Such internally generated heat is mainly an incidental product of the animal's routine metabolism, but under conditions of excessive cold or low activity an endotherm might apply special mechanisms adapted specifically to heat production. Examples include special-function muscular exertion such as shivering, and uncoupled oxidative metabolism, such as within brown adipose tissue.
Only birds and mammals are extant universally endothermic groups of animals. However, Argentine black and white tegu, leatherback sea turtles, lamnid sharks, tuna and billfishes, cicadas, and winter moths are also endothermic. Unlike mammals and birds, some reptiles, particularly some species of python and tegu, possess seasonal reproductive endothermy in which they are endothermic only during their reproductive season.
In common parlance, endotherms are characterized as " warm-blooded". The opposite of endothermy is ectothermy, although in general, there is no absolute or clear separation between the nature of endotherms and ectotherms.
Endothermy was thought to have originated towards the end of the Permian Period . One recent study claimed the origin of endothermy within Synapsida (the mammalian lineage) was among Mammaliamorpha, a node calibrated during the Late Triassic period, about 233 million years ago. 
Evidence for endothermy has been found in basal synapsids (" pelycosaurs"), pareiasaurs, ichthyosaurs, plesiosaurs, mosasaurs, and basal archosauromorphs.    Even the earliest amniotes might have been endotherms. 
Many endotherms have a larger amount of mitochondria per cell than ectotherms. This enables them to generate heat by increasing the rate at which they metabolize fats and sugars. Accordingly, to sustain their higher metabolism, endothermic animals typically require several times as much food as ectothermic animals do, and usually require a more sustained supply of metabolic fuel.
In many endothermic animals, a controlled temporary state of hypothermia conserves energy by permitting the body temperature to drop nearly to ambient levels. Such states may be brief, regular circadian cycles called torpor, or they might occur in much longer, even seasonal, cycles called hibernation. The body temperatures of many small birds (e.g. hummingbirds) and small mammals (e.g. tenrecs) fall dramatically during daily inactivity, such as nightly in diurnal animals or during the day in nocturnal animals, thus reducing the energy cost of maintaining body temperature. Less drastic intermittent reduction in body temperature also occurs in other larger endotherms; for example human metabolism also slows down during sleep, causing a drop in core temperature, commonly of the order of 1 degree Celsius. There may be other variations in temperature, usually smaller, either endogenous or in response to external circumstances or vigorous exertion, and either an increase or a drop. 
The resting human body generates about two-thirds of its heat through metabolism in internal organs in the thorax and abdomen, as well as in the brain. The brain generates about 16% of the total heat produced by the body. 
Heat loss is a major threat to smaller creatures, as they have a larger ratio of surface area to volume. Small warm-blooded animals have insulation in the form of fur or feathers. Aquatic warm-blooded animals, such as seals, generally have deep layers of blubber under the skin and any pelage that they might have; both contribute to their insulation. Penguins have both feathers and blubber. Penguin feathers are scale-like and serve both for insulation and streamlining. Endotherms that live in very cold circumstances or conditions predisposing to heat loss, such as polar waters, tend to have specialised structures of blood vessels in their extremities that act as heat exchangers. The veins are adjacent to the arteries full of warm blood. Some of the arterial heat is conducted to the cold blood and recycled back into the trunk. Birds, especially waders, often have very well-developed heat exchange mechanisms in their legs—those in the legs of emperor penguins are part of the adaptations that enable them to spend months on Antarctic winter ice.   In response to cold, many warm-blooded animals also reduce blood flow to the skin by vasoconstriction to reduce heat loss. As a result, they blanch (become paler).
In equatorial climates and during temperate summers, overheating ( hyperthermia) is as great a threat as cold. In hot conditions, many warm-blooded animals increase heat loss by panting, which cools the animal by increasing water evaporation in the breath, and/or flushing, increasing the blood flow to the skin so the heat will radiate into the environment. Hairless and short-haired mammals, including humans and horses, also sweat, since the evaporation of the water in sweat removes heat. Elephants keep cool by using their huge ears like radiators in automobiles. Their ears are thin and the blood vessels are close to the skin, and flapping their ears to increase the airflow over them causes the blood to cool, which reduces their core body temperature when the blood moves through the rest of the circulatory system.
The major advantage of endothermy over ectothermy is decreased vulnerability to fluctuations in external temperature. Regardless of location (and hence external temperature), endothermy maintains a constant core temperature for optimal enzyme activity.
Endotherms control body temperature by internal homeostatic mechanisms. In mammals, two separate homeostatic mechanisms are involved in thermoregulation—one mechanism increases body temperature, while the other decreases it. The presence of two separate mechanisms provides a very high degree of control. This is important because the core temperature of mammals can be controlled to be as close as possible to the optimal temperature for enzyme activity.
The overall rate of an animal's metabolism increases by a factor of about two for every 10 °C (18 °F) rise in temperature, limited by the need to avoid hyperthermia. Endothermy does not provide greater speed in movement than ectothermy (cold-bloodedness)—ectothermic animals can move as fast as warm-blooded animals of the same size and build when the ectotherm is near or at its optimal temperature, but often cannot maintain high metabolic activity for as long as endotherms. Endothermic/homeothermic animals can be optimally active at more times during the diurnal cycle in places of sharp temperature variations between day and night and during more of the year in places of great seasonal differences of temperature. This is accompanied by the need to expend more energy to maintain the constant internal temperature and a greater food requirement.  Endothermy may be important during reproduction, for example, in expanding the thermal range over which a species can reproduce, as embryos are generally intolerant of thermal fluctuations that are easily tolerated by adults.   Endothermy may also provide protection against fungal infection. While tens of thousands of fungal species infect insects, only a few hundred target mammals, and often only those with a compromised immune system. A recent study  suggests fungi are fundamentally ill-equipped to thrive at mammalian temperatures. The high temperatures afforded by endothermy might have provided an evolutionary advantage.
Ectotherms increase their body temperature mostly through external heat sources such as sunlight energy; therefore, they depend on environmental conditions to reach operational body temperatures. Endothermic animals mostly use internal heat production through metabolic active organs and tissues (liver, kidney, heart, brain, muscle) or specialized heat producing tissues like brown adipose tissue (BAT). In general, endotherms therefore have higher metabolic rates than ectotherms at a given body mass. As a consequence they also need higher food intake rates, which may limit abundance of endotherms more than ectotherms.
Because ectotherms depend on environmental conditions for body temperature regulation, they typically are more sluggish at night and in the morning when they emerge from their shelters to heat up in the first sunlight. Foraging activity is therefore restricted to the daytime (diurnal activity patterns) in most vertebrate ectotherms. In lizards, for instance, only a few species are known to be nocturnal (e.g. many geckos) and they mostly use 'sit and wait' foraging strategies that may not require body temperatures as high as those necessary for active foraging. Endothermic vertebrate species are, therefore, less dependent on the environmental conditions and have developed a high variability (both within and between species) in their diurnal activity patterns. 
It is thought that the evolution of endothermia was crucial in the development of eutherian mammalian species diversity in the Mesozoic period. Endothermia gave the early mammals the capacity to be active during nighttime while maintaining small body sizes. Adaptations in photoreception and the loss of UV protection characterizing modern eutherian mammals are understood as adaptations for an originally nocturnal lifestyle, suggesting that the group went through an evolutionary bottleneck (the nocturnal bottleneck hypothesis). This could have avoided predator pressure from diurnal reptiles and dinosaurs, although some predatory dinosaurs, being equally endothermic, might have adapted a nocturnal lifestyle in order to prey on those mammals.  
Many insect species are able to maintain a thoracic temperature above the ambient temperature using exercise. These are known as facultative or exercise endotherms.  The honey bee, for example, does so by contracting antagonistic flight muscles without moving its wings (see insect thermoregulation).    This form of thermogenesis is, however, only efficient above a certain temperature threshold, and below about 9–14 °C (48–57 °F), the honey bee reverts to ectothermy.   
Facultative endothermy can also be seen in multiple snake species that use their metabolic heat to warm their eggs. Python molurus and Morelia spilota are two python species where females surround their eggs and shiver in order to incubate them. 
Some ectotherms, including several species of fish and reptiles, have been shown to make use of regional endothermy, where muscle activity causes certain parts of the body to remain at higher temperatures than the rest of the body.  This allows for better locomotion and use of the senses in cold environments. 
Because of historical accident,[ citation needed] students encounter a source of possible confusion between the terminology of physics and biology. Whereas the thermodynamic terms " exothermic" and " endothermic" respectively refer to processes that give out heat energy and processes that absorb heat energy, in biology the sense is effectively reversed. The metabolic terms "ectotherm" and "endotherm" respectively refer to organisms that rely largely on external heat to achieve a full working temperature, and to organisms that produce heat from within as a major factor in controlling their body temperatures.