In the first place, we would like to stress that in vitro fertilization is permissible as long as the semen and ovum are from a husband and wife who are legally married and the fertilization takes place during their marriage, not after divorce or the death of the husband.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: IVF is permissible in Islam only on condition that both sperm and egg involved in the process originate from a man and a woman who are married to each other. To introduce an egg or sperm from a third person to the equation is akin to sharing the marriage bed with someone else. It is therefore considered no different from zina (adultery) in Islam. A child born through such a procedure is born of zina in Islam.
Since it is undoubtedly reprehensible and utterly sinful, no Muslim should ever entertain such a possibility for conceiving a child. A Muslim should accept what Allah has chosen for him or her. To accept Allah as a Sovereign Lord and Creator means to believe in His will and ultimate wisdom. Allah says: (To Allah belongs the Sovereignty of the heavens and the earth. He creates whatever He wills. He grants daughters to whom He wills, and sons to whom He wills; or He gives both sons and daughters to whom He wills and makes barren whom He wills. Indeed He is Knowing, Able) (Ash-Shura 42: 49-50).
So, couples in this situation should continue to pray to Allah to grant them offspring while resorting to all available treatments they can possibly afford. If it is Allah’s will, He will certainly grant your prayer; if on the other hand, should He not choose to do so, simply accept the will of the All-Wise, and All-Knowing.
May Allah make us all contented with His decree, and grant us all the true joy of submitting to His inscrutable will. Ameen.