Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bukhari:4807Muḥammad b. ʿAbdullāh > Muḥammad b. ʿUbayd al-Ṭanāfisī > al-ʿAwwām > Saʾalt Mujāhid > Sajdah ṣ > Saʾalt Ibn ʿAbbās from Ayn Sajadt

I asked Mujahid regarding the prostration in Surat Saʿd. He said, "I asked Ibn ʿAbbas, 'What evidence makes you prostrate?' He said, "Don't you recite:--'And among his progeny, David and Solomon..(6.84). Those are they whom Allah had guided. So follow their guidance.' (6.90) So David was the one of those prophets whom Prophet (Muhammad) was ordered to follow. David prostrated, so Messenger of Allah ﷺ (Muhammad) performed this prostration too.'  

البخاري:٤٨٠٧حَدَّثَنِي مُحَمَّدُ بْنُ عَبْدِ اللَّهِ حَدَّثَنَا مُحَمَّدُ بْنُ عُبَيْدٍ الطَّنَافِسِيُّ عَنِ الْعَوَّامِ قَالَ سَأَلْتُ مُجَاهِدًا عَنْ سَجْدَةِ ص فَقَالَ سَأَلْتُ ابْنَ عَبَّاسٍ مِنْ أَيْنَ سَجَدْتَ فَقَالَ

أَوَمَا تَقْرَأُ {وَمِنْ ذُرِّيَّتِهِ دَاوُدَ وَسُلَيْمَانَ} {أُولَئِكَ الَّذِينَ هَدَى اللَّهُ فَبِهُدَاهُمُ اقْتَدِهْ} فَكَانَ دَاوُدُ مِمَّنْ أُمِرَ نَبِيُّكُمْ ﷺ أَنْ يَقْتَدِيَ بِهِ فَسَجَدَهَا رَسُولُ اللَّهِ ﷺ {عُجَابٌ} عَجِيبٌ الْقِطُّ الصَّحِيفَةُ هُوَ هَا هُنَا صَحِيفَةُ الْحَسَنَاتِ وَقَالَ مُجَاهِدٌ {فِي عِزَّةٍ} مُعَازِّينَ {الْمِلَّةِ الآخِرَةِ} مِلَّةُ قُرَيْشٍ الاِخْتِلاَقُ الْكَذِبُ الأَسْبَابُ طُرُقُ السَّمَاءِ فِي أَبْوَابِهَا {جُنْدٌ مَا هُنَالِكَ مَهْزُومٌ} يَعْنِي قُرَيْشًا {أُولَئِكَ الأَحْزَابُ} الْقُرُونُ الْمَاضِيَةُ {فَوَاقٍ} رُجُوعٍ {قِطَّنَا} عَذَابَنَا {اتَّخَذْنَاهُمْ سُخْرِيًّا} أَحَطْنَا بِهِمْ أَتْرَابٌ أَمْثَالٌ وَقَالَ ابْنُ عَبَّاسٍ الأَيْدُ الْقُوَّةُ فِي الْعِبَادَةِ الأَبْصَارُ الْبَصَرُ فِي أَمْرِ اللَّهِ {حُبَّ الْخَيْرِ عَنْ ذِكْرِ رَبِّي} مِنْ ذِكْرٍ {طَفِقَ مَسْحًا} يَمْسَحُ أَعْرَافَ الْخَيْلِ وَعَرَاقِيبَهَا {الأَصْفَادِ} الْوَثَاقِ