Insanity
Insanity, madness, lunacy, and craziness are behaviors performed by certain abnormal mental or behavioral patterns. Insanity can manifest as violations of societal norms, including a person or persons becoming a danger to themselves or to other people. Conceptually, mental insanity also is associated with the biological phenomenon of contagion (that mental illness is infectious) as in the case of copycat suicides. In contemporary usage, the term insanity is an informal, un-scientific term denoting "mental instability"; thus, the term insanity defense is the legal definition of mental instability. In medicine, the general term psychosis is used to include the presence of delusions and/or hallucinations in a patient; and psychiatric illness is "psychopathology", not mental insanity.In English, the word "sane" derives from the Latin adjective sanus, meaning "healthy". Juvenal's phrase mens sana in corpore sano is often translated to mean 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. Another Latin phrase related to our current concept of sanity is compos mentis ("sound of mind"), and a euphemistic term for insanity is non compos mentis. In law, mens rea means having had criminal intent, or a guilty mind, when the act (actus reus) was committed.
A more informal use of the term insanity is to denote something or someone considered highly unique, passionate or extreme, including in a positive sense. The term may also be used as an attempt to discredit or criticize particular ideas, beliefs, principles, desires, personal feelings, attitudes, or their proponents, such as in politics and religion.

Historical views and treatment
Madness, the non-legal word for insanity, has been recognized throughout history in every known society. Some traditional cultures have turned to witch doctors or shamans to apply magic, herbal mixtures, or folk medicine to rid deranged persons of evil spirits or bizarre behavior, for example. Archaeologists have unearthed skulls (at least 7000 years old) that have small, round holes bored in them using flint tools. It has been conjectured that the subjects may have been thought to have been possessed by spirits that the holes would allow to escape. More recent research on the historical practice of trepanning supports the hypothesis that this procedure was medical in nature and intended as means of treating cranial trauma.

Ancient Greece
The Greeks appeared to share something of the modern Western world's secular and holistic view, believing that afflictions of the mind did not differ from diseases of the body. Moreover, they saw mental and physical illness as a result of natural causes and an imbalance in bodily humors. Hippocrates frequently wrote that an excess of black bile resulted in irrational thinking and behavior.

Ancient Rome
Romans made other contributions to psychiatry, in particular a precursor of some contemporary practice. They put forward the idea that strong emotions could lead to bodily ailments, the basis of today's theory of psychosomatic illness. The Romans also supported humane treatment of the mentally ill, and in so doing, codified into law the principle of insanity as a mitigation of responsibility for criminal acts, although the criterion for insanity was sharply set as the defendant had to be found "non compos mentis", a term meaning "not sound of mind".

From the Middle Ages onward
The Middle Ages witnessed the end of the progressive ideas of the Greeks and Romans.During the 18th century, the French and the British 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 disorder, speech impediments, epilepsy, and depression or being pregnant out of wedlock.
Europe's oldest asylum was the precursor of today's Bethlem Royal Hospital in London, known then as Bedlam, which began admitting the mentally ill in 1403 and is mentioned in Chaucer's Canterbury Tales. 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.

Medicine
Insanity is no longer considered a medical diagnosis but is a legal term in the United States, stemming from its original use in  common law. The disorders formerly encompassed by the term covered a wide range of mental disorders now diagnosed as bipolar disorder, organic brain syndromes, schizophrenia, and other psychotic disorders.

Law
In United States criminal law, insanity may serve as an affirmative defense to criminal acts and thus does not need to negate an element of the prosecution's case such as general or specific intent. Each U.S. state differs somewhat in its definition of insanity but most follow the guidelines of the Model Penal Code. 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 their behavior at the time of the offense. For example, if the defendant was compelled by some aspect of their mental illness to commit the illegal act, the defendant could be evaluated as not in control of their 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.
Insanity is generally no defense in a civil lawsuit, but an insane plaintiff can toll the statute of limitations for filing a suit until gaining sanity, or until a statute of repose has run.

Feigning
Feigned insanity is the simulation of mental illness in order to deceive. Amongst other purposes, insanity is feigned in order to avoid or lessen the consequences of a confrontation or conviction for an alleged crime. A number of treatises on medical jurisprudence were written during the nineteenth century, the most famous of which was Isaac Ray in 1838 (fifth edition 1871); others include Ryan (1832), Taylor (1845), Wharton and Stille (1855), Ordronaux (1869), Meymott (1882). The typical techniques as outlined in these works are the background for Dr. Neil S. Kaye's widely recognized guidelines that indicate an attempt to feign insanity.One famous example of someone feigning insanity is Mafia boss Vincent Gigante, who pretended for years to be suffering from dementia, and was often seen wandering aimlessly around his neighborhood in his pajamas muttering to himself. Testimony from informants and surveillance showed that Gigante was in full control of his faculties the whole time, and ruled over his Mafia family with an iron fist.Today feigned insanity is considered malingering. In a 2005 court case, United States v. Binion, the defendant was prosecuted and  convicted for  obstruction of justice (adding to his original  sentence) because he feigned insanity in a Competency to Stand Trial evaluation.

Insult
In modern times, labeling someone as insane often carries little or no medical meaning and is rather used as an insult or as a reaction to behavior perceived to be outside the bounds of accepted norms. For instance, the definition of insanity is sometimes colloquially purported to be "doing the same thing over and over again and expecting a different result." However, this does not match the legal definition of insanity.

See also
Rosenhan, David L.

References
External links
 Media related to Insanity at Wikimedia Commons
 The dictionary definition of insanity at Wiktionary
 Quotations related to Insanity at Wikiquote
"On Being Sane in Insane Places"