All praise is due to Allah, and may exaltation and safety be granted to Muhammad, his family, his companions, and those who follow them. To proceed:
[Q]: What is the Islamic ruling on learning contemporary knowledge such as medicine, engineering and other than that pertaining to what the Muslims are in need of?
[A]: One of our elder and highly-respected scholars, Shaykh, Dr. Rabee’ b. Haadee al-Madkhalee (1), may Allah safeguard him from all that is evil, elaborated on this question by saying:
I say, no doubt, the Muslims are certainly in need of [learning about] medicine and engineering, after we have learned what is obligatory upon us to learn about al-Islaam. This is because knowledge is [two types]: individual knowledge and communal knowledge…
Individual knowledge is the knowledge that every Muslim must know. There are facts about Islam that every person must know. Then, after that, there is communal knowledge: knowledge that a sufficient number of Muslims must take on the responsibility of learning.
Some examples of communal knowledge are learning medicine, engineering, chemistry, etc. Learning these fields or professions is communal knowledge, and whoever learns them desiring to service the Muslims and al-Islaam, [he has rendered an admirable service]. However, there are those who possibly learn these things only to obtain a profession, and it is possible that he does not connect them to al-Islaam.
So, it is upon all Muslims to associate this knowledge with al-Islaam and to produce a benefit for the Muslims. He reminds himself that the Muslims are in need of doctors, so he says: ‘I desire to fill a void and free the Muslims from being in need of a Jew, Christian, communist, or a secularist.’ Possessing this type of intention, maa shaa Allah, will, in shaa Allah, make his actions worship and a way of drawing nearer to Allah.
The same can be said about engineering, chemistry, farming, economics, and whatever else he learns with the good intention of filling a void [of the Muslims] and fulfilling the obligation of communal knowledge. This is an action that he is applauded for, in shaa Allah. (2)
Nevertheless, be extremely cautious of not having noble goals when learning, even when it pertains to the knowledge Muhammad, may Allah exalt his mention and grant him safety, came with. And I believe I have slightly alluded to this point in what has preceded. I always mention this when these affairs are brought up. I mention that we are in need of Muslims to learn these things, and that they are necessary.
(1) Rabee’ b. Haadee al-Madkhalee is one of Saudi Arabia’s well-respected scholars. He has surpassed the age of eighty years, thus, combining between insight, wisdom and knowledge.
(2) Rabee’ al-Madkhalee, “Welcome, O’ Student of Knowledge,” pp. 353-354