Bathgate ( or , ) is a town in West Lothian, Scotland, west of Livingston and adjacent to the M8 motorway. Nearby towns are Armadale, Blackburn, Linlithgow, Livingston, West Calder and Whitburn. Situated south of the ancient Neolithic burial site at Cairnpapple Hill, Bathgate and the surrounding area show signs of habitation since about 3500 BC and the world's oldest known reptile fossil has been found in the town. By the 12th century, Bathgate was a small settlement, with a church at Kirkton and a castle south of the present day town centre. Local mines were established in the 17th century but the town remained small in size until the coming of the industrial revolution. By the Victorian era, Bathgate grew in prominence as an industrial and mining centre, principally associated with the coal and shale oil industries. By the early 20th century, much of the mining and heavy industry around the town had ceased and the town developed manufacturing industries, principally in vehicle production and later electronics before these factories closed in the late 20th century. Today Bathgate is the second largest town in West Lothian, after Livingston and serves as a regional commuter town within the Scottish Central Belt. History Medieval (c1100–1500) Bathgate first enters the chronicles of history in a confirmation charter by King Malcolm IV of Scotland (1141 – 9 December 1165). In royal charters of the 12th, 13th and 14th centuries, the name of Bathgate has appeared as: Bathchet (1160), Bathket (1250) and Bathgetum (1316). Batket in the 14th century, and by the 15th appeared as both Bathgat and Bathcat, the latter an offshoot of Uchtred Dalrymple's feudal lineage, which ruled during ancient times. The name is a "manifest corruption" of an earlier Cumbric name meaning 'Boar Wood' (cf. Welsh baedd coed). Early records of Bathgate are somewhat sketchy. It is recorded that, around 1160, Uchtred Dalrymple, Sheriff of Linlithgow, and Geoffrey de Melville came to Bathgate at the command of King Malcolm IV and measured out an area of land which was to form the basis of Bathgate Parish. The church and all its associate property were placed under the auspices of Holyrood Abbey at that time and paid a tenth of its income from the land to that institution. In 1315, the daughter of King Robert I of Scotland (Robert The Bruce), Marjorie (alternatively spelt Margery) Bruce, married Walter Stewart (or Steward) (1293–1326),