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.
bayhaqi:3821[Chain 1] Abū al-Ḥasan ʿAlī b. Aḥmad b. ʿAbdān > Aḥmad b. ʿUbayd al-Ṣaffār > Muḥammad b. al-Faraj al-Azraq > Ḥajjāj / Ibn Muḥammad > Qāl Ibn Jurayj [Chain 2] Abū ʿAlī al-Rūdhbārī > Abū Bakr b. Dāsah > Abū Dāwud > Aḥmad b. Ibrāhīm > Ḥajjāj > Ibn Jurayj > ʿAbdullāh b. Musāfiʿ > Muṣʿab b. Shaybah > ʿUtbah b. Muḥammad b. al-Ḥārith > ʿAbdullāh b. Jaʿfar

[Machine] The Messenger of Allah ﷺ said, "Whoever doubts about his prayer, let him prostrate twice after he has finished the prayer. This narration is acceptable except that the narration of Abu Sa'id Al-Khudri is more authentic, along with the narration of Abdul Rahman ibn Awf and Abu Hurairah, according to what we mentioned. And Allah knows best."  

البيهقي:٣٨٢١أَخْبَرَنَا أَبُو الْحَسَنِ عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ أنبأ أَحْمَدُ بْنُ عُبَيْدٍ الصَّفَّارُ ثنا مُحَمَّدُ بْنُ الْفَرَجِ الْأَزْرَقُ ثنا حَجَّاجٌ يَعْنِي ابْنَ مُحَمَّدٍ قَالَ قَالَ ابْنُ جُرَيْجٍ ح وَأَخْبَرَنَا أَبُو عَلِيٍّ الرُّوذْبَارِيُّ أنبأ أَبُو بَكْرِ بْنُ دَاسَةَ ثنا أَبُو دَاوُدَ ثنا أَحْمَدُ بْنُ إِبْرَاهِيمَ ثنا حَجَّاجٌ عَنِ ابْنِ جُرَيْجٍ قَالَ أَخْبَرَنِي عَبْدُ اللهِ بْنُ مُسَافِعٍ أَنَّ مُصْعَبَ بْنَ شَيْبَةَ أَخْبَرَهُ عَنْ عُتْبَةَ بْنِ مُحَمَّدِ بْنِ الْحَارِثِ عَنْ عَبْدِ اللهِ بْنِ جَعْفَرٍ

أَنَّ رَسُولَ اللهِ ﷺ قَالَ مَنْ شَكَّ فِي صَلَاتِهِ فَلْيَسْجُدْ سَجْدَتَيْنِ بَعْدَ أَنْ يُسَلِّمَ هَذَا الْإِسْنَادُ لَا بَأْسَ بِهِ إِلَّا أَنَّ حَدِيثَ أَبِي سَعِيدٍ الْخُدْرِيِّ أَصَحُّ إِسْنَادًا مِنْهُ وَمَعَهُ حَدِيثُ عَبْدِ الرَّحْمَنِ بْنِ عَوْفٍ وَأَبِي هُرَيْرَةَ عَلَى مَا نَذْكُرُهُ وَاللهُ أَعْلَمُ