Praise be to Allah.
Shaykh Muhammad ibn Saalih al-Uthaymeen (may Allaah have mercy on him) was asked this question, and replied as follows:
I say that this is undoubtedly jihad for the sake of Allaah, for a person to study these theories that go against Islam in order to refute them from a standpoint of knowledge.
Hence the Prophet (peace and blessings of Allaah be upon him) said to Mu’aadh, when he sent him to Yemen, “I am sending you to some people from among the People of the Book.” (Narrated by al-Bukhaari, Kitaab al-Zakaah, 1395; Muslim, Kitaab al-Eemaan, 29). He told him about them so that he would be prepared to deal with them. Similarly, the scholars who studied these matters, such as Shaykh al-Islam Ibn Taymiyah, who studied various branches of knowledge and philosophical issues and the like so that he could refute their proponents.
If you are studying these matters in order to refute them, and you are confident that you are able to refute them without being affected by them, because you worship Allaah much and fear Him, then I hope in sha Allaah that this will be good for you and of benefit to the Muslims. But if you cannot refute them in a rational manner or with proof, do not follow this route. Similarly if you are not completely certain and deeply convinced, then I advise you to leave these matters alone, for they are dangerous. No one should expose himself to problems when there is the fear that he is not able to tackle them properly.