Al Ghazali was born in northern Persia in 1058 AD, under the rule of the Seljuks. His father followed Sufism. But he died when Al Ghazali was still a boy. One of his father’s friends took al Ghazali and his brother in. When Al Ghazali was twelve years old, he left home to go to a madrassa in a bigger city, Gurgan.
At the madrassa in Gurgan, Al Ghazali studied the works of earlier philosophers. But he wasn’t happy with the answers he found there. Most of the philosophers he studied followed Neo-Platonist ideas. They thought that people’s souls were all pieces of one universal divine spirit. Your soul returned to join that divine spirit when you died. But Al-Ghazali wanted ideas based on scientific experiments and proof, not just ideas.
When Al-Ghazali grew up, he eventually (in 1091 AD) became a professor at the sultan‘s university in Baghdad. Al-Ghazali wrote a book called “On the Incoherence of the Philosophers”. He argued against Aristotle and Plato, and against Ibn Sina. Al-Ghazali rejected the Greek philosophers because they were not Muslims. He argued that what looks to us like the laws of nature is really just proof that Allah is a rational god who acts in consistent and reasonable ways. So gravity and inertia are not laws of nature, but laws of God.
In this way, Al-Ghazali could do scientific research while still believing in God. He continued his scientific research. He followed the Greek astronomers Thales and Anaxagoras in correctly understanding how solar eclipses and lunar eclipses work. Al-Ghazali also studied mathematics, arguing that math was a different subject from religion. He thought you couldn’t learn anything about God by doing math, or about math by studying God. Like Lucretius, Al-Ghazali thought that everything in the world was made of tiny atoms. But he thought the atoms were arranged into patterns by God.
But after only four years, Al-Ghazali decided to quit being a professor. He gave away all his money, left his family, and lived the life of a poor Sufi religious man. As a Sufi beggar, he travelled to Damascus and Jerusalem, and then to Medina and Mecca, before coming home to Tus. Al-Ghazali died in Tus in 1111 AD, when he was 53 years old.
After Al-Ghazali died, the philosopher Ibn Rushd wrote a defence of Aristotle against Al-Ghazali. But despite this effort, Al-Ghazali’s work encouraged many later Islamic astronomers to rely on their own observations instead of philosophy to describe the stars and planets.