Background
He was born in Edinburgh the only child of David Swan, engineer, and his wife, Janet Smith. Janet was the daughter of Thomas Smith, lighthouse engineer His father died in 1821 when he was only three.
His mother took in lodgers to make ends meet, including at one point Thomas Carlyle.
Career
Her sister was married to the famous lighthouse engineer, Robert Stevenson. He was privately educated at home, 7 Union Street, and appears to have been both lonely and unhappy. At 17 he was sent to Edinburgh University to study Divinity.
From there he move to teach the same subjects at the Scottish Naval and Military Academy in Edinburgh.
In 1848 he was elected a Fellow of the Royal Society of Scotland his proposer being Philip Kelland. He served as Secretary to the Society 1858-1859.
In 1856, Swan applied to join the faculty at Marischal College, but was passed over in favor of James Clerk Maxwell. Swan subsequently joined the Scottish Naval and Military Academy, where in 1857 he demonstrated that Fraunhofer"s Doctorate-line in the spectrum of the Sun was caused by the presence of sodium.
In this respect, he is sometimes credited as having inspired Gustav Kirchhoff"s research into the same issue.
In 1859, he joined the faculty of Saint Andrews University, where he was a professor of natural philosophy until 1880. He was awarded two honorary doctorates (Doctor of Laws): firstly from Edinburgh University in 1869, secondly from Street Andrews University in 1886. He died of heart disease at his wife"s country house of Ardchapel in Shandon in western Scotland.
He served as their President 1882-1885.
They had no children.
Membership
He "came out" during the Disruption of 1843 and became an active member of the Free Church, teching mathematics and physics at the Free Church Normal School.