@RiazHaq , do you have any links to Ghazalis work's? Ive recently been reading Ibn Khaldun's Al Muqaddimah (https://asadullahali.files.wordpress.com/2012/10/ibn_khaldun-al_muqaddimah.pdf). Wouldnt mind reading up on what Ghazali specifically has to say on Ijtihad.
With regards to the decline of the sciences in the Islamic world there are a multitude of reasons in my opinion. I am open to corrections.
1) One of the biggest reasons is the geopolitical change in the Muslim world which saw the decline of Ummayad Spain into Taifa's which the Christians gobbled up one by one. Roughly simultaneously the Mongols emerged in the East and ransacked C. Asia, Persia and finally Baghdad. Cordoba and Baghdad were the intellectual hubs of the Islamic world within which were stored the intellectual wealth of not only Islamic scholars but also the works of the ancient Greeks, Persians etc. To emphasize this point it is said that when Hulagu Khan captured Baghdad whereas usually the rivers were said to turn red after the Mongols ransacked a city, in the case of Baghdad the Tigris is said to have turned black because so much paper and parchments were thrown into the river that the ink from them turned the river black. Baghdad was of course home to the Bayt al Hikma (House of Wisdom), House of Wisdom - Wikipedia, the free encyclopedia The loss of major intellectual hubs such as Cordoba and Baghdad deprived future Muslims of the knowledge of their predecessors.
2) Building upon the first point, during the end of the Golden Age also began the Crusade for Palestine which saw the emergence of a Frankish Christian state right at the heart of the Muslim world. The resources of all Muslim states in the region were thus geared towards regaining Jerusalem and religious dogmatism will surely have entered the mindset of Muslims of that time i.e. we are loosing lands and wars because we are Bad Muslims, therefore we need to become more orthodox Muslims to regain our former political glory.
3) Up to the latter Middle Ages, the Middle East had been dominated ethnically by Arabs, Persians and pre Turkish Anatolians (Armenians, Assyrians etc). However gradually nomadicTurkic tribes started migrating into the Mid East bringing their warlike culture to the use of the Islamic cause in Palestine and Anatolia. A general rule is that nomads due to scarcity of resources and lack of a sedentary lifestyle will not attach that much importance to the sciences. The earliest humans for example were primitive but as we urbanized so did our ability to maximize our intellectual capacity. The migrations of the Turkic tribes thus changed the demographic makeup of large parts of the Mid East and being nomads who only gradually adopted a sedentary lifestyle they would have placed little value on patronizing scientists and men of arts as compared to the Abbasid Caliphs of Baghdad who had a vast amount of resources to allocate to such purposes.
4) With the eventual failure of the Crusades, the Islamic world was for centuries roguhly divided up into three major Empires, the Ottomans from Algeria to Iraq, the Safavids from Checnya/Azerbaijan to W. Afghanistan and the Mughals from E Afghanistan to Bengal. These three empires were largely secure in their borders and only occasionally had any major territorial disputes. Further they benefitted greatly form the tariffs they imposed on silk route traders carrying goods from E Asia to Europe.
If one thus juxtaposes late Medieval, early Renaissance Middle East/South Asia with Europe the situation is totally different. Europe which is roughly the same size of the three Islamic Empires previously mentioned was divided up into dozens of small states all vying and competing with each other for dominance. There was serious competition amongst these states thus and this prompted European rulers to invest heavily in the sciences especially in relation to warfare. The heavy taxes that the Europeans had to pay the Muslims for E. Asia goods also prompted them to look for alternative routes to the East which resulted in their discovery of the Americas (which they subsequently plundered and looted). Europe thus gained a major advantage over the Islamic Empires but only so because the Europeans due to tough competition at home had a greater incentive to invest in the sciences so as to stay ahead of their rivals. All this time however the Osmanlis, Safavids and Mughals were comparatively safe and secure in their borders and thus had no real incentives to invest in arms and naval technology, gradually thus falling behind.
You will find support for your explanation of the decline in Ibn Khaldun's work.
Haq's Musings: Search results for Ibn Khaldun
Ibn Khaldun has argued in his masterpiece"Muqaddima" that tribesmen and barbarians have often had more courage and social cohesion than settled and civilized folk. He cited many instances in history when rag-tag bands of ill-educated and uncivilized insurgents have swept in and conquered lands whose rulers became corrupt and complacent.
As to Ghazali, there's been a lot of discussion on Ibn Rushd versus Ghazali which illuminates the debate between Revelation-inspired Ghazali and Greek-inspired Muslim philosophers like Ibn Sina, Al Farabi and Ibn Rushd.
Ibn Rushd’s Defence of Philosophy as a Response to Ghazali’s Challenge in the Name of Islamic Theology