Through history, the systems of economic support for scientists and their work have been important determinants of the character and pace of scientific research. The ancient foundations of the sciences were driven by practical and religious concerns and or the pursuit of philosophy more generally. From the Middle Ages until the Age of Enlightenment, scholars sought various forms of noble and religious patronage or funded their own work through medical practice. In the 18th and 19th centuries, many disciplines began to professionalize, and both government-sponsored "prizes" and the first research professorships at universities drove scientific investigation. In the 20th century, a variety of sources, including government organizations, military funding, patent profits, corporate sponsorship, and private philanthropies, have shaped scientific research.
Most early advances in mathematics, astronomy and engineering were byproducts of more immediate and practical goals. Surveying and accounting needs drove ancient Egyptian, Babylonian, Chinese, and Indian mathematics, while calendars created for religious and agricultural purposes drove early astronomy.
Modern science owes much of its heritage to ancient Greek philosophers; influential work in astronomy, mechanics, geometry, medicine, and natural history was part of the general pursuit of philosophy. Architectural knowledge, especially in ancient Greece and Rome, also contributed to the development of mathematics, though the extent of the connection between architectural knowledge and more abstract mathematics and mechanics is unclear.
State policy has influenced the funding of public works and science for thousands of years, dating at least from the time of the Mohists, who inspired the study of logic during the period of the Hundred Schools of Thought, and the study of defensive fortifications during the Warring States period in China. General levies of labor and grain were collected to fund great public works in China, including the accumulation of grain for distribution in times of famine, for the building of levees to control flooding by the great rivers of China, for the building of canals and locks to connect rivers of China, some of which flowed in opposite directions to each other, and for the building of bridges across these rivers. These projects required a civil service, the scholars, some of whom demonstrated great mastery of hydraulics.