Nucleophilic substitution
In organic and inorganic chemistry, nucleophilic substitution is a fundamental class of substitution reaction in which an "electron rich" nucleophile selectively bonds with or attacks the positive charge of a group or atom called the leaving group; rarely referred to as an electrophobe.
The most general form for the reaction may be given as
The electron pair (:) from the nucleophile (Nuc) attacks the substrate (R-LG) forming a new bond, while the leaving group (LG) departs with an electron pair.  The principal product in this case is R-Nuc.  The nucleophile may be electrically neutral or negatively charged, whereas the substrate is typically neutral or positively charged.
An example of nucleophilic substitution is the hydrolysis of an alkyl bromide, R-Br, under alkaline conditions, where the attacking nucleophile is the OH and the leaving group is Br-.
Nucleophilic substitution reactions are commonplace in organic chemistry, and they can be broadly categorised as taking place at an aliphatic (saturated) carbon or at (less often) an aromatic or other unsaturated carbon centre.

# Nucleophilic substitution at saturated carbon centres

## SN1 and SN2 reactions
In 1935, Edward D. Hughes and Sir Christopher Ingold studied nucleophilic substitution reactions of alkyl halides and related compounds.  They proposed that there were two main mechanisms at work, both of them competing with each other. The two main mechanisms are the SN1 reaction and the SN2 reaction. S stands for chemical substitution, N stands for nucleophilic, and the number represents the kinetic order of the reaction.
In the SN2 reaction, the addition of the nucleophile and the elimination of leaving group take place simultaneously.  SN2 occurs where the central carbon atom is easily accessible to the nucleophile. By contrast the SN1 reaction involves two steps.  SN1 reactions tend to be important when the central carbon atom of the substrate is surrounded by bulky groups, both because such groups interfere sterically with the SN2 reaction (discussed above) and because a highly substituted carbon forms a stable carbocation.
Initially, the rate of the nucleophilic substitution was a little puzzling as the rate followed the pattern :
CH3X > primary > secondary < tertiary
The reaction kinetics changed from second order to first order.
The SN1 and SN2 reactions are influenced by different factors
SN1 reactivity rates follow the trend CH3X < primary < secondary < tertiary
SN2 reactivity rates follow the trend CH3X > primary > secondary > tertiary
The total reactivity is the sum of the two rates.
File:Sn2 Sn1 Graph.png
A graph showing the relative reactivities of the different alkyl halides towards SN1 and SN2 reactions.  Also see Table 1.

# Nucleophilic substitution reactions
There are many reactions in organic chemistry that involve this type of mechanism.  Common examples include
- organic reductions with hydrides, for example
- hydrolysis reactions such as
- Williamson ether synthesis
- the Wenker synthesis which is a ring-closing reaction of aminoalcohols
- The Finkelstein reaction is an halide exchange reaction and phosphorus nucleophiles appear in the Perkow reaction and the Michaelis-Arbuzov reaction.

## Other mechanisms
Besides SN1 and SN2, other mechanisms are known, although they are less common.  The SNi mechanism is observed in reactions of thionyl chloride with alcohols, and it is similar to SN1 except that the nucleophile is delivered from the same side as the leaving group.
Nucleophilic substitutions can be accompanied by an allylic rearrangement as seen in reactions such as the Ferrier rearrangement.  This type of mechanism is called an SN1' or SN2' reaction (depending on the kinetics).  With allylic halides or sulphonates, for example, the nucleophile may attack at the  unsaturated carbon in place of the carbon bearing the leaving group.  This may be seen in the reaction of 1-chloro-2-butene with sodium hydroxide to give a mixture of 2-buten-1-ol and 1-buten-3-ol:
The Sn1CB mechanism appears in inorganic chemistry.

# Nucleophilic substitution at unsaturated carbon centres
Nucleophilic substitution via the SN1 or SN2 mechanism does not generally occur with vinyl or aryl halides or related compounds.  Under certain conditions nucleophilic substitutions may occur, via other mechanisms such as those described in the nucleophilic aromatic substitution article.
When the substitution occurs at the carbonyl group, the acyl group may undergo nucleophilic acyl substitution.  This is the normal mode of substitution with carboxylic acid derivatives such as acyl chlorides, esters and amides.