Answer
Asalamu Alaikum Jaheda,
Thank you for contacting About Islam with your.
In fact, Yusuf Ali has already given you the answer. There is no contradiction among the three verses talking about the duration of breastfeeding or gestation.
The three verses you mentioned in the Quran limit the recommended period for breastfeeding to 24 months.
In the third verse, from Surat Al-Ahqaf, the duration of both gestation and breastfeeding is altogether 30 months.
This means that the duration of gestation could, in some rare cases, be six months, and that a normal labor with good survival potential could start from the sixth month of pregnancy.
The question that arises here is why should God give us the minimum rare case to demonstrate the issue instead of the normal case?
The answer is related to the unparalleled precision of the Quranic language. The Quran is the source of a strong legal system, which rules over people’s lives, and like—if not superior to—any legal text, the language should be accurate.
In the case you are talking about, if the duration of pregnancy is stated to be only that of nine months, and that the only viable babies are those born after nine months, this will lead to legal confusion concerning the issue of paternity.
The following story may demonstrate how Allah’s keenness to mention the minimum rather than the normal period of gestation helped to clear up a very thorny legal matter:
In one important incident, a woman gave birth after six-months of pregnancy; her husband, seeing the baby is alive and healthy, thought that his wife became pregnant from an affair before marrying him—on the assumption that normal labor only occurs after 9 months—therefore, he denied paternity and went to the ruler, `Uthman ibn `Affan.
Although the woman cried and affirmed the boy’s legitimacy, the Caliph, on hearing the case, ordered the woman to be sentenced to death for adultery.
The story reached `Ali ibn Abi Talib, who was known for his unparalleled knowledge of every single word in the Quran. He asked `Uthman, “What are you doing?” `Uthman answered, “She gave birth to a perfect child after six months! How could this happen?”
Ali Answered, “Don’t you read Quran?” ‘Uthman answered, “Yes, I do.” Ali asked, “Haven’t you heard God saying:
{[…] and the carrying of him and the weaning of him is thirty months.} Then saying, {Mothers shall suckle their children for two whole years.} Then the difference between the two periods together and the period of nursing becomes six months.”
`Uthman said, “By God, I hadn’t recognized this perfection before”. And he set the woman free.
Thus, God had to state all possible cases for the duration of gestation for legal considerations, especially when related to a sensitive issue like that of paternity and women’s honor.
I don’t think that the beginning of the verse is rhetorically related to its end, which talks about man repenting at the age of forty.
The first part, as I have just explained, is a legal ruling while the other is a moral direction and a wake-up call for people to repent at the age of wisdom before it is too late. Apparently, there is no connection between them concerning what is normal and what is not.
Thanks a lot for your question and I hope to hear from you again.
Walaikum Asalam.
Please continue feeding your curiosity, and find more info in the following links:
What Your Body Needs During Pregnancy