Add punctuation: As to the Mathematical Society of which I was a member when only 18 years of age having been contrary to the rules elected under the age of 21
A: As to the Mathematical Society, of which I was a member when only 18 years of age, having been, contrary to the rules, elected under the age of 21.

Add punctuation: In May 1851 Boole was elected as Dean of Science a role he carried out conscientiously
A: In May 1851 Boole was elected as Dean of Science, a role he carried out conscientiously.

Add punctuation: In mainland China and the island of Taiwan Standard Chinese mandarin is the common language
A:
In mainland China and the island of Taiwan, Standard Chinese (mandarin) is the common language.