Question: What subject was studied in the city where Abbasid Court was based?

full_context: Document 1: Umayyad Caliphate: The Quran and Muhammad talked about racial equality and justice as in The Farewell Sermon. Tribal and nationalistic differences were discouraged. But after Muhammad's passing, the old tribal differences between the Arabs started to resurface. Following the Roman–Persian Wars and the Byzantine–Sassanid Wars, deep rooted differences between Iraq, formally under the Persian Sassanid Empire, and Syria, formally under the Byzantine Empire, also existed. Each wanted the capital of the newly established Islamic State to be in their area. Previously, the second caliph Umar was very firm on the governors and his spies kept an eye on them. If he felt that a governor or a commander was becoming attracted to wealth, he had him removed from his position.
Document 2: Umayyad Caliphate: Early Muslim armies stayed in encampments away from cities because Umar feared that they might get attracted to wealth and luxury. In the process, they might turn away from the worship of God and start accumulating wealth and establishing dynasties. When Uthman ibn al-Affan became very old, Marwan I, a relative of Muawiyah I, slipped into the vacuum, became his secretary, slowly assumed more control and relaxed some of these restrictions. Marwan I had previously been excluded from positions of responsibility. In 656, Muhammad ibn Abi Bakr, the son of Abu Bakr, the adopted son of Ali ibn Abi Talib, and the great grandfather of Ja'far al-Sadiq, showed some Egyptians the house of Uthman ibn al-Affan. Later the Egyptians ended up killing Uthman ibn al-Affan.
Document 3: History of mathematics: Babylonian mathematics refers to any mathematics of the peoples of Mesopotamia (modern Iraq) from the days of the early Sumerians through the Hellenistic period almost to the dawn of Christianity. The majority of Babylonian mathematical work comes from two widely separated periods: The first few hundred years of the second millennium BC (Old Babylonian period), and the last few centuries of the first millennium BC (Seleucid period). It is named Babylonian mathematics due to the central role of Babylon as a place of study. Later under the Arab Empire, Mesopotamia, especially Baghdad, once again became an important center of study for Islamic mathematics.
Document 4: Mesopotamia: Mesopotamia is a historical region in West Asia situated within the Tigris -- Euphrates river system, in modern days roughly corresponding to most of Iraq plus Kuwait, the eastern parts of Syria, Southeastern Turkey, and regions along the Turkish -- Syrian and Iran -- Iraq borders.
Document 5: Umayyad Caliphate: The Umayyads have met with a largely negative reception from later Islamic historians, who have accused them of promoting a kingship (mulk, a term with connotations of tyranny) instead of a true caliphate (khilafa). In this respect it is notable that the Umayyad caliphs referred to themselves not as khalifat rasul Allah ("successor of the messenger of God", the title preferred by the tradition), but rather as khalifat Allah ("deputy of God"). The distinction seems to indicate that the Umayyads "regarded themselves as God's representatives at the head of the community and saw no need to share their religious power with, or delegate it to, the emergent class of religious scholars." In fact, it was precisely this class of scholars, based largely in Iraq, that was responsible for collecting and recording the traditions that form the primary source material for the history of the Umayyad period. In reconstructing this history, therefore, it is necessary to rely mainly on sources, such as the histories of Tabari and Baladhuri, that were written in the Abbasid court at Baghdad.
Document 6: Umayyad Caliphate: The Umayyad Caliphate (Arabic: الخلافة الأموية‎, trans. Al-Khilāfat al-ʾumawiyya) was the second of the four major Islamic caliphates established after the death of Muhammad. This caliphate was centered on the Umayyad dynasty (Arabic: الأمويون‎, al-ʾUmawiyyūn, or بنو أمية, Banū ʾUmayya, "Sons of Umayya"), hailing from Mecca. The Umayyad family had first come to power under the third caliph, Uthman ibn Affan (r. 644–656), but the Umayyad regime was founded by Muawiya ibn Abi Sufyan, long-time governor of Syria, after the end of the First Muslim Civil War in 661 CE/41 AH. Syria remained the Umayyads' main power base thereafter, and Damascus was their capital. The Umayyads continued the Muslim conquests, incorporating the Caucasus, Transoxiana, Sindh, the Maghreb and the Iberian Peninsula (Al-Andalus) into the Muslim world. At its greatest extent, the Umayyad Caliphate covered 15 million km2 (5.79 million square miles), making it the largest empire (in terms of area - not in terms of population) the world had yet seen, and the fifth largest ever to exist.
Document 7: History of science: In Babylonian astronomy, records of the motions of the stars, planets, and the moon are left on thousands of clay tablets created by scribes. Even today, astronomical periods identified by Mesopotamian proto-scientists are still widely used in Western calendars such as the solar year and the lunar month. Using these data they developed arithmetical methods to compute the changing length of daylight in the course of the year and to predict the appearances and disappearances of the Moon and planets and eclipses of the Sun and Moon. Only a few astronomers' names are known, such as that of Kidinnu, a Chaldean astronomer and mathematician. Kiddinu's value for the solar year is in use for today's calendars. Babylonian astronomy was "the first and highly successful attempt at giving a refined mathematical description of astronomical phenomena." According to the historian A. Aaboe, "all subsequent varieties of scientific astronomy, in the Hellenistic world, in India, in Islam, and in the West—if not indeed all subsequent endeavour in the exact sciences—depend upon Babylonian astronomy in decisive and fundamental ways."
Document 8: Umayyad Caliphate: According to tradition, the Umayyad family (also known as the Banu Abd-Shams) and Muhammad both descended from a common ancestor, Abd Manaf ibn Qusai, and they originally came from the city of Mecca. Muhammad descended from Abd Manāf via his son Hashim, while the Umayyads descended from Abd Manaf via a different son, Abd-Shams, whose son was Umayya. The two families are therefore considered to be different clans (those of Hashim and of Umayya, respectively) of the same tribe (that of the Quraish). However Muslim Shia historians suspect that Umayya was an adopted son of Abd Shams so he was not a blood relative of Abd Manaf ibn Qusai. Umayya was later discarded from the noble family. Sunni historians disagree with this and view Shia claims as nothing more than outright polemics due to their hostility to the Umayyad family in general. They point to the fact that the grand sons of Uthman, Zaid bin amr bin uthman bin affan and Abdullah bin Amr bin Uthman got married to the Sukaina and Fatima the daughters of Hussein son of Ali to show closeness of Banu hashem and Bani Ummayah.
Document 9: Umayyad Caliphate: Many Muslims criticized the Umayyads for having too many non-Muslim, former Roman administrators in their government. St John of Damascus was also a high administrator in the Umayyad administration. As the Muslims took over cities, they left the peoples political representatives and the Roman tax collectors and the administrators. The taxes to the central government were calculated and negotiated by the peoples political representatives. The Central government got paid for the services it provided and the local government got the money for the services it provided. Many Christian cities also used some of the taxes on maintain their churches and run their own organizations. Later the Umayyads were criticized by some Muslims for not reducing the taxes of the people who converted to Islam. These new converts continues to pay the same taxes that were previously negotiated.
Document 10: History of science: From their beginnings in Sumer (now Iraq) around 3500 BC, the Mesopotamian people began to attempt to record some observations of the world with numerical data. But their observations and measurements were seemingly taken for purposes other than for elucidating scientific laws. A concrete instance of Pythagoras' law was recorded, as early as the 18th century BC: the Mesopotamian cuneiform tablet Plimpton 322 records a number of Pythagorean triplets (3,4,5) (5,12,13). ..., dated 1900 BC, possibly millennia before Pythagoras,  but an abstract formulation of the Pythagorean theorem was not.
Document 11: History of science: In mathematics, the Persian mathematician Muhammad ibn Musa al-Khwarizmi gave his name to the concept of the algorithm, while the term algebra is derived from al-jabr, the beginning of the title of one of his publications. What is now known as Arabic numerals originally came from India, but Muslim mathematicians did make several refinements to the number system, such as the introduction of decimal point notation. Sabian mathematician Al-Battani (850-929) contributed to astronomy and mathematics, while Persian scholar Al-Razi contributed to chemistry and medicine.
Document 12: Muslim world: The Islamic Golden Age coincided with the Middle Ages in the Muslim world, starting with the rise of Islam and establishment of the first Islamic state in 622. The end of the age is variously given as 1258 with the Mongolian Sack of Baghdad, or 1492 with the completion of the Christian Reconquista of the Emirate of Granada in Al-Andalus, Iberian Peninsula. During the reign of the Abbasid caliph Harun ar-Rashid (786 to 809), the legendary House of Wisdom was inaugurated in Baghdad where scholars from various parts of the world sought to translate and gather all the known world's knowledge into Arabic. The Abbasids were influenced by the Quranic injunctions and hadiths, such as "the ink of a scholar is more holy than the blood of a martyr," that stressed the value of knowledge. The major Islamic capital cities of Baghdad, Cairo, and Córdoba became the main intellectual centers for science, philosophy, medicine, and education. During this period, the Muslim world was a collection of cultures; they drew together and advanced the knowledge gained from the ancient Greek, Roman, Persian, Chinese, Indian, Egyptian, and Phoenician civilizations.
Document 13: Umayyad Caliphate: The Umayyad caliphate was marked both by territorial expansion and by the administrative and cultural problems that such expansion created. Despite some notable exceptions, the Umayyads tended to favor the rights of the old Arab families, and in particular their own, over those of newly converted Muslims (mawali). Therefore, they held to a less universalist conception of Islam than did many of their rivals. As G.R. Hawting has written, "Islam was in fact regarded as the property of the conquering aristocracy."
Document 14: Umayyad Caliphate: Non-Muslim groups in the Umayyad Caliphate, which included Christians, Jews, Zoroastrians, and pagan Berbers, were called dhimmis. They were given a legally protected status as second-class citizens as long as they accepted and acknowledged the political supremacy of the ruling Muslims. They were allowed to have their own courts, and were given freedom of their religion within the empire.[citation needed] Although they could not hold the highest public offices in the empire, they had many bureaucratic positions within the government. Christians and Jews still continued to produce great theological thinkers within their communities, but as time wore on, many of the intellectuals converted to Islam, leading to a lack of great thinkers in the non-Muslim communities.
Document 15: Ancient Near East: The ancient Near East was the home of early civilizations within a region roughly corresponding to the modern Middle East: Mesopotamia (modern Iraq, southeast Turkey, southwest Iran, northeastern Syria and Kuwait), ancient Egypt, ancient Iran (Elam, Media, Parthia and Persia), Anatolia / Asia Minor and Armenian Highlands (Turkey's Eastern Anatolia Region, Armenia, northwestern Iran, southern Georgia, and western Azerbaijan), the Levant (modern Syria, Lebanon, Palestine, Israel, and Jordan), Cyprus and the Arabian Peninsula. The ancient Near East is studied in the fields of Near Eastern archaeology and ancient history.
ground_truth: Islamic mathematics
sub_queries: Where was the Abbasid court based? Answer: Baghdad
What subject was studied in Baghdad ? Answer: Islamic mathematics