Nizam al-Mulk, the Seljuk vizier, recognized the great potential in Ghazali as a scholar and appointed him as the head of Nizamiyya madarasa in Baghdad. Ghazali was the student of Al-Juwayni, under whom he studied religious sciences, including Islamic law and jurisprudence.
Kimyā-ye Sa'ādat is shorter than this book however, Ghazali said that he wrote the former to reflect the nature of the latter and a few of his other theological writings. Some consider Kimiyā-ye Sa'ādat (Alchemy of Happiness) as a rewrite of this work, which is a common misconception. It originally spanned 40 volumes and dealt with Islamic concepts and practices, demonstrating how these might be formed the foundation of reflective religious life, thereby attaining the higher stages of Sufism. It is regarded as one of his chief works and a classic introduction to the pious Muslim's path to God, and is probably the most impactful book in Islamic history after the Quran and Hadith.
The book was composed in Arabic by Al-Ghazali on his spiritual crises that stemmed from his appointment as the head of the Nizzamiyya University in Baghdad, which led to his eventual disappearance from the Muslim world for over 10 years. The Revival of the Religious Sciences ( Arabic: إِحْيَاءُ عُلُومِ ٱلْدِّينِ, romanized: Iḥyā′u ‘Ulūmi d-Dīni) is a 12th-century book written by the Persian scholar Abu Hamid al-Ghazali.