"Tom o' Bedlam", also known as "Mad Tom", "Mad Maudlin's Search" or "Mad Maudlin's Search for Her Tom of Bedlam" was originally from Thomas d'Urfey's Pills to Purge Melancholy, published in 1720.
The priory of St. Mary of Bethlehem at Bishopsgate founded in 1247 became the male lunatic asylum known as Bethlehem Hospital or Bedlam in 1547. In 1815 it was moved to Lambeth in the buildings now housing the Imperial War Museum and in 1931 was moved to Beckenham in Kent. The hospital of St. Mary Magdalen (pronounced Maudlin) was its female counterpart.
There are many verses collected from various sources. Most performers sing only a small subset of them.
The song was referenced in Ben Jonson's The Devil is an Ass (1616).
This tune is one of two associated with "Tom of Bedlam" in Chappell's Popular Music of the Olden Time (1859). It is also used for "The Famous Ratcatcher".
It was recorded by John Roberts and Tony Barrand on Dark Ships in the Forest (1977), Steeleye Span on Please to See the King (1971) and this track was later included on the Martin Carthy anthology The Carthy Chronicles, Steeleye Span again on Dodgy Bastards (2016).