What is the knowledge that will benefit a person after death?
Question

What is the knowledge that will benefit a person, that is referred to in the hadith “When the son of Adam dies, all his good deeds come to an end except three…”? Does that refer only to Islamic knowledge, or can it be extended to beneficial worldly knowledge? I have a doctorate, and by His grace, Allah has granted me considerable knowledge in various fields, in physics, astronomy, mathematics and other subjects. I want to set up a website to make a series of video lectures on these subjects, so that high school and university students can benefit from them, for free, and to help them in pass their exams in school on the one hand, and on the other hand so that they may learn about the wonders of Allah’s creation in the universe, through astronomy, and I want to do that for the sake of Allah. Does this work come under the heading of beneficial knowledge that will benefit me after I die, or not?
Praise be to Allah.Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked about the words of the Prophet (blessings and peace of Allah be upon him): “When the son of Adam dies, his good deeds come to an end except three: ongoing charity, beneficial knowledge…” -- Does this refers to Islamic knowledge or worldly knowledge?
He replied: What appears to be the case is that the hadith is general in meaning, and for any knowledge that is beneficial, he will attain reward. But first and foremost among that is Islamic knowledge. If we assume that a person dies having taught some people a permissible kind of craft or manufacturing, and what he taught was beneficial, then he will attain reward and will be rewarded for that.
End quote from Liqaa’ al-Baab al-Maftooh (117/16).
Moreover, what you plan to do by setting up this website is something good and beneficial, in sha Allah, and undoubtedly learning these things is useful and beneficial for the ummah. In fact, they come under the heading of communal obligations, as there must be among the ummah those who meet its needs in various fields.
If we add to that your desire to make difficult things easy for your brothers, and help them in their studies, then that will increase your reward with Allah, if you are sincere towards Allah, may He be exalted, in your intention when doing such things. Allah, may He be exalted, says (interpretation of the meaning):
“So whoever does an atom’s weight of goodwill see it,
And whoever does an atom’s weight of evil will see it”
[az-Zalzalah 99:6-7].
And the Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever removes a worldly hardship from a believer, Allah will remove one of the hardships of the Day of Resurrection from him. Whoever grants respite to (a debtor) who is in difficulty, Allah will grant him relief in this world and in the Hereafter. Whoever conceals (the fault of) a Muslim in this world, Allah will conceal him (his faults) in this world and in the Hereafter. Allah will help a person so long as he is helping his brother. Whoever follows a path seeking knowledge, Allah will make a path to Paradise easy for him…” Narrated by Muslim (2699).
And Allah knows best.