It is recorded by the two Imams—al-Bukhari (1880) and Muslim (721)—from Abu Hurayrah who said: “My intimate friend, the Messenger of Allah (peace and blessings be upon him), instructed me to do three things: to fast three days of every month, to pray two rakʿahs at Duha, and to offer Witr before I sleep.”
2 – Hadith no. 314 demonstrates the legality of the Duha prayer and that the Prophet (peace and blessings be upon him) used to perform four rakʿahs, adding to that whatever Allah willed.
3 – Hadith no. 315 shows that he would not pray it except when returning from a journey; thus it appears to qualify the first report, limiting his observance of it to the time when he arrived home from travel.
4 – Hadith no. 316 indicates that he never prayed it at all. This is understood as further qualifying hadith no. 315, namely that he did not perform it except on returning from an absence.
Because of this divergence—whether he prayed it or did not—Ibn al-Qayyim devoted an extended discussion to the matter in Zad al-Maʿad, explaining how to reconcile the seemingly conflicting reports. He said: People have approached these hadiths along several lines:
(a) Some have preferred the reports of performance over those of non-performance, arguing that they contain additional knowledge that escaped the second set, and that the one who preserved the information is a proof against the one who did not.
(b) A second group opted for the reports of non-performance, giving them precedence on the grounds of the soundness of their chains of transmission and the practice of the Companions. Al-Bukhari relates that “the Prophet (peace and blessings be upon him) did not pray it, nor did Abu Bakr or ʿUmar.”
(c) A third group held that it is recommended to perform it intermittently—on some days but not others. This is one of the two reports from Ahmad, and al-Tabari transmitted it from a number of scholars; they based their view on hadith no. 315.
(d) Ibn Jarir maintained that there is actually no contradiction in the reports, saying: “There is nothing in…"