Answered by Shaykh Muhammad ibn Adam al-Kawthari
I am well aware that playing the piano is haram. However an imam in our area has stated that if one was to learn the piano with the aim of seeking knowledge (as opposed to learning the piano to simply play it), then it is acceptable. This sounds really weird. Can you please either confirm or refute this statement with references.

In the name of Allah, Most Compassionate, Most Merciful,
The relied upon and mainstream opinion of the scholars is that all musical instruments besides the tambourine (duff) are not permitted. This is what we find quite evidently in the great works of the four Sunni schools of Islamic law. (For details, see an earlier post titled “Music and singing: A detailed Fatwa”)
Some scholars did allow instruments if they were not used for vain purposes as long as this was free of other impermissible matters. However, this remains a minority opinion which goes against the stance of the majority of this Umma’s scholars.
Thus, to play the piano with the aim of seeking knowledge will still not be permitted. Playing the piano is not permitted whether one plays it to seek knowledge or other vain purposes. This is what I have understood from my teachers and consider to be the truth.
[Please listen to Shaykh Nuh Keller’s explanation of the impermissibility of instrumental music:
Listening to the recorded music
And Mufti Muhammad ibn Adam’s own detailed fatwa on the subject:
Music and Singing: A Detailed Fatwa
And Allah knows best
Muhammad ibn Adam al-Kawthari
Darul Iftaa, Leicester, UK