Insanity
Insanity, or madness, is a general popular and legal term defining behavior influenced by mental instability. It is defined by the Merriam-Webster dictionary as a deranged state of the mind or lack of understanding. Today it is most commonly encountered as an informal term or in the narrow legal context of the insanity defense, and in the medical profession, the term is now avoided in favor of specific diagnoses of mental illness as  schizophrenia and other psychotic disorders.

# Linguistic roots
In English, the word "sane" derives from the Latin adjective sanus meaning healthy. The phrase "mens sana in corpore sano" means a "healthy mind in a healthy body". From this perspective, insanity can be considered as poor health of the mind, not necessarily of the brain as an organ (although that can affect mental health), but rather refers to defective function of mental processes such as reasoning. A Latin phrase for "sane" is "compos mentis" (lit. "of composed mind"), and a euphemistic term for insanity is "non compos mentis".

# In Medicine
Insanity as a diagnosis is now considered to be outdated. The disorders formerly encompassed by the term are schizophrenic and other psychotic disorders. These are characterized by social withdrawal, deterioration of personal care, inability to perceive oneself as a separate entity, rapid shifting of thought and topic, autistic absorption, hallucinatory symptoms, delusions and often depersonalization. Symptoms can be singular or combined with a wide variation among sufferers. Motor activity is generally reduced and appearance become bizarre while perceptual and conversational distortions are evident.
Medical disorders as thyroid dysfunction, adrenal or pituitary disorders may contribute to the above symptoms and must be ruled out before a psychiatric diagnosis is made. Medical treatment includes hospitalization and antipsychotic medication. Prognosis is usually excellent in alleviation of symptoms but the disorder may be recurrent when medication is halted.

# Historical treatment
During the 18th century, the French and English introduced humane treatment of the clinically insane, though the criteria for diagnosis and placement in an asylum were considerably looser than today, often including such conditions as speech impediments and epilepsy.
The world's oldest asylum is The Bethlem Royal Hospital of London, also known as Bedlam, which began admitting the mentally ill in 1403. The first American asylum was built in Williamsburg, Virginia, circa 1773. Before the 19th century these hospitals were used to isolate the mentally ill or the socially ostracized from society rather than cure them or maintain their health. Pictures from this era portrayed patients bound with rope or chains, often to beds or walls, or restrained in straitjackets.

# Legal use of the term
While in criminal law, insanity may serve as a defense to criminal acts, in most U.S. states, jurisdictions differ in their definition of insanity. All jurisdictions require  a sanity evaluation to  address the question first of whether or not the defendant has a mental illness. Most courts  accept a major mental illness such as psychosis but will not accept the diagnosis of a personality disorder for the purposes of an insanity defense. The second question is whether the mental illness interfered with the defendant's ability to  distinguish right from wrong. That is, did the defendant  know that the alleged behavior was against the law at the time the offense was committed. Additionally, some jurisdictions add the question of whether or not the defendant was in control of his behavior at the time of the offense. For example, if the defendant compelled by some aspect of his mental illness to commit the illegal act, the defendant could be evaluated as not in control of his behavior at the time of the offense.  The forensic mental health specialists submit their evaluations to the court. Since the question of sanity or insanity is a legal question and not a medical one, the judge and or jury will make the final decision regarding the defendant's status regarding an insanity defense.
In most jurisdictions within the United States, if the  insanity  plea is accepted, the defendant is committed to a psychiatric institution for at least 60 days for further evaluation, and then  reevaluated at least yearly after that.

## Mitigating factor
The United States Supreme Court in Penry v. Lynaugh and the United States Court of Appeals for the Fifth Circuit in Bigby v. Dretke have been clear in their decisions that  jury instructions in death penalty cases that do not ask about mitigating factors regarding the defendant's mental health violate the defendant's Eighth Amendment rights,  saying that the jury is to be instructed to consider mitigating factors when answering unrelated questions. This ruling suggests specific explanations to jury is  necessary to weigh mitigating factors.

# Slang usage
In popular culture, "insane" could also refer to something extremely foolish, while persons may be deemed "insane" if their behavior strongly deviates from accepted social norms; in the past, insanity has been used to refer to individuals who have exhibited apathetic, cruel, hypersexual and homosexual behavior.  The term is typically negative, but departure from established norms may also be seen as a positive quality; in this case, being "insane" is being daringly unconventional or individualistic. This use of insane is illustrated by the following quote from Henry David Thoreau's A Plea for Captain John Brown, an essay supporting the well-known militant abolitionist:
Many, no doubt, are well disposed, but sluggish by constitution and by habit, and they cannot conceive of a man who is actuated by higher motives than they are, accordingly they pronounce this man insane, for they know that they could never act as he does, as long as they are themselves.
In this sense, "insanity" is not implied to be an actual disorder, let alone severe.