Alexander W. Roberts was trained as a teacher in Edinburgh at Moray House (a Free Church College for teacher training) and the Heriot-Watt College, graduating at the University of Edinburgh. He had been interested in astronomy from an early age, but when he applied to the Astronomer Royal for Scotland, Charles P. Smyth*, for a post as assistant was advised not to become a professional astronomer. After teaching at Wick (in northern Scotland, near his birthplace) for three years he obtained a post at the University of Edinburgh. In 1883 he was appointed as teacher at the training school of the Free Church Mission College at Lovedale, near Alice in the Eastern Cape. He remained there until 1920, acting as principal during 1899-1901 and 1902-1904. In 1884 he married Elizabeth Dunnett, with whom he had one son and two daughters.
Though his days were fully occupied with teaching, Roberts retained a strong interest in astronomy, particularly in variable stars. In 1888, equipped with a pair of field-glasses and a second-hand theodelite, he started observing the few known variable stars of the southern hemisphere, and searching for new ones. This made him the first regular observer of southern variable stars. In consultation with his friend Dr David Gill* of the Royal Observatory, Cape of Good Hope, he erected a small observatory at Lovedale and by 1894 had discovered 20 new variable stars south of declination -30º, four of them eclipsing binaries of the Algol type. The results of his first decade of work were presented in ten papers published in the Transactions of the South African Philosophical Society (1890-1897, Vols 8 and 9) and in some 30 papers in overseas journals during 1893-1900, mainly in the Astronomical Journal, Astrophysical Journal, and Astronomische Nachrichten. He was particularly interested in eclipsing binary stars and for his work on this group the University of the Cape of Good Hope conferred on him its first honorary Doctor of Science (DSc) degree on 10 August 1899.
British patrons of science who recognised the value of his work presented him with improved instruments, including a telescope with a rotating prism in front of the objective (designed by Gill) which he received from Sir John Usher in 1900. These instruments enabled him to precisely compare the brightness of a variable star to that of a distantly situated comparison star. His most detailed observations were made of the eclipsing binaries RS Sagitarii, RR Centauri, and V Puppis. However, the importance of his work lies not only in extended series of precise brightness measurements, but in their interpretation. From the light curves of these stars he deduced parameters such as the period of revolution of the binary system, the size and eccentricity of the orbit, the relative brightness of the component stars, their distance apart, their relative masses, and even distortions of shape resulting from the intense tidal forces acting on two stars revolving almost in contact. Thus he was able to determine observationally that the component stars of V Puppis were spheroidal (rather than spherical) in shape - a finding that was in line with theoretical derivations by Sir George Darwin* and others. Similarly he was able to determine that the two stars of RR Centauri coalesce, forming a rotating dumbbell shape.
At the first congress of the South African Association for the Advancement of Science in 1903 Roberts reported the preliminary results he had obtained on five binary systems. Two years later, at the joint meeting in South Africa of the British and South African Associations for the Advancement of Science, he updated his findings in a classic paper on "Apioidal [i.e., prolate] binary star systems". The paper was one of the few published in full in the British Association's Report for 1905 and was also included in the Addresses and papers... published after the meeting (Vol. 1, pp. 26-39). By this time Roberts had made about 250 000 independent observations of stellar brightness. Another important contribution to the study of Algol binaries was his finding that the average density of eight southern Algol variables is only one ninth that of the sun - a result that was important in the study of stellar evolution. He investigated the long term increases in the periods of some close binary stars (1908, 1915). Other (non-binary) variable stars also drew his attention. During the late 1890's he collaborated with W.H. Finlay* and R.T.A. Innes* of the Royal Observatory, Cape of Good Hope, in a long series of observations of the variable star eta Argus. He also made an extensive series of observations of the Cepheid variable S Arae, leading to several papers. Other work included his calculations of the paths of future solar eclipses visible in South Africa (Transactions of the South African Philolosophical Society, 1890-1895, Vol. 8, pp. 93-119), and his investigation of the absorption of starlight by the earth's atmosphere at various angles of elevation (Transactions of the Royal Society of South Africa, 1910-1912, Vol. 1, pp. 1-7).
Roberts is regarded as the second most important amateur astronomer (after Sir John Herschel*) to have worked in South Africa and his work inspired other amateur astronomers, particularly variable star observers. In addition to his astronomical work he was a meteorological observer for the Meteorological Commission of the Cape of Good Hope. A summary of his observations at Lovedale was published in several of the Commission's annual reports between 1893 and 1900. However, his busy schedule of teaching by day and astronomical observation at night left little time for sleep and probably affected his health. Hence as early as 1897 he had to return to Scotland for a period of rest and recuperation. In later years he remained unable to find sufficient time to reduce many of his long series of observations and this work remained unpublished after his death.
Roberts was elected a Fellow of the Royal Astronomical Society in 1894, of the Royal Society of Edinburgh in 1898, and of the newly named Royal Society of South Africa in 1908. In 1892 he became a member of the South African Philosophical Society for a number of years. As a foundation member of the South African Association for the Advancement of Science (1902) he was a recipient of a grant of £100 in support of his work on variable stars, served as president of Section A of the Association (which included astronomy) in 1908, received its South Africa Medal (gold) in 1912 in recognition of his astronomical work, was president of the association at its annual congress in 1913, and president of Section E in 1922. At the founding of the Cape Astronomical Association in November 1912 he was elected joint vice-president, and when the Astronomical Society of South Africa was formed in 1922 he was again elected to the same position. He served as president of the latter society in 1927/8, and in 1929 was a member of the South African National Committee in Astronomy.
Roberts's labours in the cause of native education later led him to represent the indigenous population as a senator of the Union of South Africa from 1920 to 1929, and as a member (later chairman) of the Native Affairs Commission from 1920 to 1935. During these years he served on several commissions of enquiry into various aspects of native affairs, for example, as chairman of the commission to enquire into the Bondelzwarts rebellion in South West Africa (now Namibia) in 1922, and as chairman of the commission to enquire into the origin and influence of Native churches in South Africa, issuing his report in 1925. In 1919 he gave temporary help in teaching mathematics at the South African Native College, Fort Hare. In 1921 he was a member of the commission of enquiry into the system of land surveying in South Africa, and in 1925 attended the meeting of the International Astronomical Union as a South African representative. The next year he published an important paper on the probable growth of the South African population (South African Journal of Science, 1926, Vol. 23, pp. 909-923). He was an excellent speaker, an authority on all matters relating to race and colour, and highly respected for his impartiality, modesty, sympathy and tolerance for different views. His last public lectures on astronomy were delivered at the Herschel Centenary Celebrations in 1934.