As an extension to the question, what factors lead to the Middle East falling behind in science and mathematics after so many mathematical discoveries were made in that region, such as the invention/discovery of algebra?
Why just the Middle East? You have to remember that Islamic "civilisation" includes the Turkumens as wellas the Persians and the Arabs and it actually stretched along the Silk Road towards India (source of a lot of maths) and Central Asia, which had the Astronomer, Mathematician and Sultan Ulugh Bek. He built an observatory in the 1420s in Samarkand. At the other end, in Istanbul, you had the observatory of Taqi al-Din. In both cases religion seems to have been an issue or at least an excuse for their destruction within about a century of each other.
Btw, it was a visit to a dusty little hill-side just outside Samarkand (his observatory) that got me interested in Ulugh Bek. The works of Timur are much more obvious, but Ulegh seemed more interesting with his emphasis on knowledge rather than conquest.
In the 1st Century, there was the famous Greco-Roman Ptolemy but he was in Alexandria, so could be claimed also by the Middle-East but this is pre-Islam times. We had people like Copernicus and Brae in Europe, but the work done in the observatories of Ulugh Bek and Taqi al-Din was arguably more comprehensive. In the early 17th century, Europe discovered the telescope. Until this point, I would say that the Islamic world really had the advantage, probably in connection to calculations needed such as the location of Mecca, the time and the start of Ramadan.
After the 17th Century the Islamic world really didn't catch up as the emphasis went away from astronomy.