Muwatta Malik, Book 3, Hadith 170 (In-Book)

Yahya related to me from Malik that Ibn Shihab used to say, "When a man catches the raka he says, 'Allah is greater' once, and that takbir is enough for him." Malik added, "That is if he intended to begin the prayer by that takbir " Malik was asked about a man who began with the imam but forgot the opening takbir and the takbir of the ruku until he had done one raka. Then he remembered that he had not said the takbir at the opening nor in the ruku,so he said the takbir in the second raka. He said, "I prefer that he start his prayer again, but if he forgets the opening takbir with the imam and says the takbir in the first ruku, I consider that enough for him if he intends by it the opening takbir." Malik said, about some one who prayed by himself and forgot the opening takbir, "He begins his prayer afresh." Malik said, about an imam who forgot the opening takbir until he had finished his prayer, "I think that he should do the prayer again, and those behind him, even if they have said the takbir."

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

sunnah.com

also referenced under: Book 3, Hadith 23 (USC-MSA)