A yawn (from the Middle English yanen, an alteration of yonen or yenen, which in turn comes from the Old English geonian), is a reflex of simultaneous inhalation of air and stretching of the eardrums, followed by exhalation of breath. Pandiculation is the term for the act of stretching and yawning simultaneously.
Yawning is associated with tiredness, stress, overwork, lack of stimulation, or boredom. Yawning can also be a powerful non-verbal message with several possible meanings, depending on the circumstances. In humans, yawning has an infectious quality, i.e. seeing a person yawning, or just thinking of yawning, can trigger yawning which is a typical example of positive feedback.. Infectious yawning has also been noted in chimpanzees. The exact causes of yawning are still undetermined. The claim that yawning is caused by lack of oxygen has not been substantiated scientifically. Some claim that yawning is not caused by lack of oxygen, for the reason that yawning allegedly reduces oxygen intake compared to normal respiration. Another speculated reason for yawning is nervousness and is also claimed to help increase the state of alertness of a person - paratroopers have been noted to yawn in the moments before they exit the aircraft.

In 2007, researchers from the University of Albany proposed that yawning may be a means to keep the brain cool. Mammalian brains operate best within a narrow temperature range. In two experiments, they demonstrated that both subjects with cold packs attached to their foreheads and subjects asked to breathe strictly nasally exhibited reduced contagious yawning when watching videos of people yawning. A similar recent hypothesis is that yawning is used for regulation of body temperature.
Another hypothesis is that yawns are caused by the same chemicals (neurotransmitters) in the brain that affect emotions, mood, appetite, and other phenomena. These chemicals include serotonin, dopamine, glutamic acid, and nitric oxide. As more (or less) of these compounds are activated in the brain, the frequency of yawning increases. Conversely, a greater presence in the brain of opiate neurotransmitters such as endorphins reduces the frequency of yawning. Patients taking the selective serotonin reuptake inhibitors Paxil (paroxetine HCl) or Celexa (citalopram) have been observed yawning more often. Excessive yawning is more common during the first three months of taking the SSRI's. Anecdotal reports by users of psilocybin mushrooms often describe a marked stimulation of yawning while intoxicated, often associated with excess lacrimation and nasal mucosal stimulation, especially while "peaking" (i.e., undergoing the most intense portion of the psilocybin experience). While opioids have been demonstrated to reduce this yawning and lacrimation provoked by psilocybin, it is not clear that the same pathways that induce yawning as a symptom of opioid abstinence in habituated users are the mode of action in yawning in mushroom users. While even opioid-dependent users of psilocybin on stable opioid therapy often report yawning and excess lacrimation while undergoing this entheogenic mushroom experience, there are no reports in the literature of habituated users experiencing other typical opioid withdrawal symptoms such as cramping, physical pain, anxiety, gooseflesh, etc. on mushrooms
Recent research carried out by Catriona Morrison, a lecturer in psychology at the University of Leeds, involving monitoring the behavior of students kept waiting in a reception area, indicates a connection (supported by neuro-imaging research) between empathic ability and yawning. "We believe that contagious yawning indicates empathy. It indicates an appreciation of other people's behavioral and physiological state," said Morrison.
Yet another theory is that yawning occurs to stabilize pressure on either side of the ear drums. The deep intake of air can sometimes cause a popping sound that only the yawner can hear; this is the pressure on the middle ear such as inside an airplane and when travelling up and down hills, which cause the eardrums to be bent instead of flat. Some people yawn when storms approach, which is a sure sign that changes in pressure affect them.
Some movements in psychotherapy, such as Re-evaluation Counseling or co-counselling treatments, believe that yawning, along with laughter and crying, are means of "discharging" painful emotion, and therefore can be encouraged in order to promote physical and emotional changes.
Yawning behavior may be altered as a result of medical issues such as diabetes and adrenal conditions.
To look at the issue in terms of evolutionary advantage, if there is one at all, yawning might be a herd instinct. Other theories suggest that the yawn serves to synchronize mood gregarious animals, similar to the howling of the wolf pack. It signals tiredness to other members of the group in order to synchronize sleeping patterns and periods. This phenomenon has been observed among various primates. The threat gesture is a way of maintaining order in the primates' social structure. Specific studies were conducted on chimpanzees and stumptail macaques. A group of these animals was shown a video of other conspecifics yawning; both species yawned as well. This helps to partly confirm a yawn's "contagiousness."
Gordon Gallup, who hypothesizes that yawning may be a means of keeping the brain cool, also hypothesizes that "contagious" yawning may be a survival instinct inherited from our evolutionary past. "During human evolutionary history when we were subject to predation and attacks by other groups, if everybody yawns in response to seeing someone yawn, the whole group becomes much more vigilant, and much better at being able to detect danger."
A recent study by the University of London has suggested that the "contagiousness" of yawns by a human will pass to dogs. The study observed that 21 of 29 dogs yawned when a stranger yawned in front of them, but did not yawn when the stranger only opened his mouth.
Other superstitions include:
These superstitions may not only have arisen to prevent people from committing the faux pas of yawning loudly in another's presence—one of Mason Cooley's aphorisms is "A yawn is more disconcerting than a contradiction" — but may also have arisen from concerns over public health. Polydore Vergil (c. 1470–1555), in his De Rerum Inventoribus, writes that it was customary to make the sign of the cross over one's mouth, since "alike deadly plague was sometime in yawning, wherefore men used to fence themselves with the sign of the cross...which custom we retain at this day.