Sanskrit/Sandhi

Note: this link gives online access to the great Monier-Williams Sanskrit-English Dictionary.
For the purposes of this discussion, the following system of transliteration is used to represent the Sanskrit alphabet:
[Note that proper nouns are not capitalized in this system. The accent in words like "jn'Ana" can be readily omitted [= "jnAna"], as likewise with "an;ga" [="anga"]. The ungainly "chchh" can conveniently be written "cch".]
Sanskrit spelling is perfectly phonetic. At the same time, the pronunciation of many letters is affected when they come in contact with particular letters. For this reason, the perfectly phonetic spelling creates inconsistencies. 'Undoing' these inconsistencies is the first task of a translator.
Alphabet.
The Sanskrit alphabet contains 42 letters ["varNa"s]: 9 vowels ["svere"s] and 33 consonants ["vyanjana"s].
Vowels.
There are 5 simple svaras ["a i u R L"], and four diphthongs ["e ai o au"].
A vowel may be short ["hrasva"], long ["dIrgha"], or protracted ["pluta"], according to its length. The lengths are respectively 1, 2, and 3 beats ["mAtra"s]. Thus:
Nasalization.
Vowels may be sounded with or without nasalization [anunAsika or ananunAsika], as in French. Nasalization is indicated by the letter "M", a form called "anusvAra". 
Tones.
Vedic Sanskrit also distinguishes tones of vowel, but they are disregarded in Classical Sanskrit. The tones or accents are acute ["udAtta"], grave ["anudAtta"], and circumflex ["svarita"].
Consonants ["vyanjanas"].
The 33 consonants are grouped, according to their articulation, as mutes [sparsha], intermediate semivowels [antastha], and sibilants [Ushman]. The sparshas are further grouped into five vargas, according to the place of articulation. These are the vyan'janas:
The first two letters in each of the 5 vargas [k, kh, ch, chh, etc.] are called surds or hard consonants. The other three in each varga are sonants or soft consonants.
Visarga.
"Visarga" is a hard breathing that is badly pronounced by modern speakers. It is, in fact, a vestigial sound, like the letter 's' or 'r' when the tongue does not quite contact the roof of the mouth a whispered "shh". It never has the sound of "hah", a pronunciation that violates the meter of the verse in which it is read.
Aspiration.
Consonants are with or without breath [mahAprANa or alpaprANa]. The 1st and 3d letters of each varga, together with the 5th [nasals], and the semivowels, are alpaprANa, the rest are mahAprANa.
Locus ["sthAna"].
The vargas are based on the locus of articulation. The gutturals [kaNTha] are formed in the throat; the palatals [tAlu] on the palate; the linguals with the tongue on the roof of the mouth [mUrdhan]; the dentals on the teeth [danta]; and the labials on the lips [oShThau].
Elision.
The "avagraha" sign is used to mark the elision of "a" and is here indicated by a single apostrophe. The initial "a-" is elided after final "-e" or "-o", thus: "te" + "api" = "te 'pi", them too; "kAla:" + "asti" = "kAlo" + "asti" = "kAlo 'sti", it's time. When "A" follows "A" it is elided, and such elision may optionally be shown by the double "avagraha", thus: "tathA" + "Aste" = "tathA "ste", or "tathAste", so be it.
Vowel weight.
Vowels have three degrees of weight: Simple, "guNa", and "vRddhi". For each of the vowels, these degrees are shown below:
Having these definitions in mind, we can proceed to the rules of sandhi.
[The following summary of the rules of sandhi is based on M.R. Kale’s grammar of 1894.]
The term sandhi derives from "sam" ‘together’ and "dhA" ‘to join’. It indicates the coalescence of two letters on account of phonetic principles.
== sandhi of vowels [svara-sandhi].
Simple Vowels.
When a simple vowel, whether short or long, is followed by a similar simple vowel, short or long, the two vowels are replaced by the corresponding long vowel: for example:
When different simple vowels are combined, the corresponding "guNa" letter replaces them, e.g.:
Exceptions:.
When "a" or "A" is followed by "e" or "ai" and "o" or "au", then "ai" and "au" are the substitutes, e.g.: "kRShNa" + "ekatvam" = "kRShNaikatvam", oneness with Krshna; "deva" + "aishvaryam" = "devaishvaryam", divine majesty; "sA" + "eva" = "saiva", she alone; "bhava" + "auShadham", medicine against reincarnation; "vidyA" + "autsukyam" = "vidyautsukyam", longing for wisdom.