Does a father educating his children come under the heading of knowledge that will benefit him after he dies?
Question

I am a female obstetrician and gynaecologist (OB/GYN). Is my late father’s having spent on my education regarded as knowledge that will benefit him? Is it permissible for me to form the intention and dedicate the reward of my work to him, so that the reward for reducing the pain of my female patients, and protecting their ‘awrahs from being uncovered in front of male doctors, will reach him after he has died? Is this scenario included in the hadith, “When the son of Adam dies, his good deeds come to an end except three”– one of which is beneficial knowledge?
Praise be to Allah.What your father did of spending on your education in this specialty will undoubtedly bring great reward, and what a father spends on his child is one of the greatest types of charity. The Prophet (blessings and peace of Allah be upon him) stated that spending on one’s child brings great reward, and it takes precedence over other kinds of charity.
In the hadith it says that the Messenger of Allah (blessings and peace of Allah be upon him) said: “The best dinar that a man spends is a dinar that he spends on his dependents, and a dinar that a man spends on his mount (for jihad) in Allah’s cause, and a dinar that he spends on his companions (in jihad) in Allah’s cause.”
Abu Qilabah said: He started with the dependents. Then Abu Qilabah said: What man is greater in reward than a man who spends on young dependents and protects them from resorting to asking of people – or Allah benefits them through him – and makes them independent of means? Narrated by Muslim (994).
Secondly:
The knowledge that you learned brings great benefit to Muslim women and provides them with medical treatment without having to see male doctors; this is one of the greatest benefits of which your father was a cause. It is known that a benefit that has far-reaching effect will bring reward to the one who initiated it, even if he did not have that particular intention in mind.
So we hope that there will be much good and great reward for your father for everyone who benefits from your treating them, because of his contribution and his being the cause of your education, without anything being detracted from your reward, in sha Allah.
Whoever is the cause of some good deed being done will have a reward like that of the doer. It was narrated that Abu Mas‘ud al-Ansari said: A man came to the Messenger of Allah (blessings and peace of Allah be upon him) and said: My mount has died; give me a mount. He said: “I do not have anything.” A man said: O Messenger of Allah, I will tell him about someone who will give him a mount. The Messenger of Allah (blessings and peace of Allah be upon him) said: “The one who tells another about a good deed is like the one who does it.” Narrated by Muslim (1893).
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said: [If someone does] deeds from which others benefit, he will be rewarded for benefitting others, even if he did not have that intention when he did that deed. Hence the Prophet (blessings and peace of Allah be upon him) stated that if someone sows a crop or plants a tree, and an animal eats from it or someone steals from it, he will be rewarded for that, even though he may have planted it without forming that intention; rather so long as people benefit from it, he will be rewarded for that.
This is also indicated by the verse in which Allah, may He be exalted, says (interpretation of the meaning):
{No good is there in much of their private conversation, except for those who enjoin charity or that which is right or conciliation between people} [an-Nisa’ 4:114].
This indicates that if a person does that, even if it is simply to bring about reconciliation between people without seeking reward, there is goodness in that. Then Allah says:
{And whoever does that seeking means to the approval of Allah - then We are going to give him a great reward} [an-Nisa’ 4:114].
This is something additional to the good which Allah mentions at the beginning of the verse."(Liqa’ al-Bab al-Maftuh  32/9).
With regard to the hadith, “When a man dies, all his good deeds come to an end except three: ongoing charity (sadaqah jaariyah), beneficial knowledge, or a  righteous son who will pray for him” [narrated by Muslim 1631], what it refers to is whatever beneficial knowledge a person teaches to others from which people benefit. That includes beneficial worldly knowledge, foremost among which is medicine. Ash-Shafa‘i (may Allah have mercy on him) said: I do not know of any knowledge, after knowledge of what is halal and haram, that is more noble than medicine. End quote from Siyar A‘lam an-Nubala’ (10/57). Medicine is only of such high status because of what it contains of goodness and benefit, and because all people need it.
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) was asked: Regarding the hadith “When a man dies, all his good deeds come to an end except three: ongoing charity (sadaqah jaariyah), [and] beneficial knowledge…”, does this refer to Islamic knowledge or worldly knowledge?
He replied: What appears to be the case is that the hadith is general in meaning; any knowledge that is of benefit will earn that reward, but the foremost knowledge is Islamic knowledge. So if we assume that a man taught someone beneficial skills, and the one who learned that from him benefitted from learning it, then he will attain the reward and be rewarded for that."(Liqa’ al-Bab al-Mahtuf  16/117).
So if someone teaches people beneficial worldly knowledge, he is included in the words of the hadith “or beneficial knowledge.” The same applies to the one who plays a role in conveying and spreading this knowledge and its benefits; there is the hope that he will also have a share of this reward, for the bounty of Allah is immense.
In the hadith narrated from ‘Uqbah ibn ‘Aamir (may Allah be pleased with him), he said: I heard the Messenger of Allah (blessings and peace of Allah be upon him) say: “Allah, may He be glorified and exalted, will admit three people to paradise by virtue of one arrow: the one who made it, intending good by making it, the one who shoots it, and the one who hands it to him.” Narrated by Ahmad in his Musnad (17300). The commentators said: The hadith is hasan when all its isnads and corroborating evidence are taken into account.
The scholars of the Permanent Committee for Ifta’ said: Printing useful books which benefit people regarding their religious and worldly affairs comes under the heading of the righteous deeds for which a person will be rewarded during his lifetime, and the reward and benefit thereof continue after he dies. That is included in the general meaning of the words of the Prophet (blessings and peace of Allah be upon him) which are soundly narrated in the hadith of Abu Hurayrah (may Allah be pleased with him), according to which the Messenger of Allah (blessings and peace of Allah be upon him) said: “When a man dies, all his good deeds come to an end except three: ongoing charity (sadaqah jaariyah), beneficial knowledge, or a  righteous son who will pray for him.”  Narrated by Muslim in his Sahih. So anyone who plays a part in spreading this beneficial knowledge will attain this great reward, whether he is an author, a teacher, a publisher who distributes it to people, a designer, or one who plays a part in printing it. Each of them will be rewarded according to his efforts and the extent of his participation in that."(Fatawa al-Lajnah ad-Da’imah  11/17).
Thus there is the hope that everyone who contributes to education, and everyone who is a cause or helps in that will have reward for the beneficial knowledge.
And Allah knows best.