Mishkat al-Masabih 1027, 1028
Ibn ‘Abbas said:
A prostration when reciting Sad (Al-Qur’an; 38) is not one of those which are divinely commanded, but I have seen the Prophet prostrate himself when it was recited. In a version Mujahid said that he asked Ibn ‘Abbas whether he should prostrate himself when reciting Sad , whereupon he recited, “And among his progeny David and Solomon . . . so copy the guidance they received,” (Al-Qur’an; 6:84-90) and said, “Your prophet was one of those who were commanded to copy them.” 

Bukhari transmitted it.
وَعَن ابْن عَبَّاس قَالَ: (سَجْدَةُ (ص)
لَيْسَ مِنْ عَزَائِمِ السُّجُودِ وَقَدْ رَأَيْتُ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يسْجد فِيهَا
وَفِي رِوَايَةٍ: قَالَ مُجَاهِدٌ: قُلْتُ لِابْنِ عَبَّاسٍ: أَأَسْجُدُ فِي (ص)
فَقَرَأَ: (وَمِنْ ذُرِّيَّتِهِ دَاوُدَ وَسليمَان)
حَتَّى أَتَى (فبهداهم اقتده)
فَقَالَ: نَبِيُّكُمْ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مِمَّنْ أَمر أَن يَقْتَدِي بهم. رَوَاهُ البُخَارِيّ