The duty of person praying in cases which are valid in the Prayers is 4 Rak-at
a- He/she should decide that she/he has performed 3 Rak-ats, and finish the prayers after performing one more Rak-at. And after finishing the prayers he/she should offer 1Rak-at of Salat-e. Ihtiyat standing or two Rak-at sitting.
b- She/he should decide that he/she has performed 4 Rak-ats and finish his/her prayer. He/she should then standup to offer 2 Rak-ats of Salat-e- Ihtiyat.
c- She/he decide that he/she has performed 4Rak-ats and finish his/her prayer. There after Salat-e- Ihtiyat of 1 Rak-at standing or 2Rak-ats in the sitting position should be offered.
d- If this doubt occurs while standing, he/she should sit down without reciting and recite Tashahhud and salam to finish the prayer. After that, 2 Rak-ats of Salat-e- Ihtiyat standing or 2 Rak-ats of Namaz-e- Ihtiyat sitting should be offered. If it occurs after the second sajdah, he/she should decide that he/she has performed 4 Rak-ats and finish the prayer.
After that he/she should perform two sajdat usshav. But if the doubt occurs after the first sajdah or before rising from the second one, he/she must act according to the rule which was said before, and as an obligatory precaution, pray again.
275 - The following doubts should be ignored, Doubts in:
* In Mustahab prayer.
* In Congregational prayer.
* After the salam of the prayer.
* After the time of prayer has past.
276 - If a person doubts about the number of Rak-ats in a Mustahab prayer and if the higher number makes the prayers void, he/she should decide on the lesser side of the doubt. For example, if he/she doubts whether he/she erformed 2 Rak-at or 3 in Nafilah of Fajr prayer, he/she should decide on having performed 2 Rak-ats. But if the higher side does not invalidate the prayer, like if he/she doubts whether he/she has performed 2Rak-ats or 1, he/she is free to decide eitherway, and his/her prayers will valid.
277 - In congregational prayers, if the Imam (one who leads the congregational prayers) doubts in the number of Rak-ats when the mamum (follower) is aware of the number and relays that to the Imam then the doubt should be ignored by Imam and simlarly if the mamum doubts he/she should follow the Imam when the Imam knows the number of Rak-ats and it is correct.
278 - If a person becomes doubtful after the Salam of prayers, as to whether or not he/she has offered the prayers correctly, like if he/she doubts whether or not he/she has performed Ruku, or doubts in a 4 Rak-ats prayer as to whether he/she has performed 4 or 5 Rak-ats, he/she should ignore his/her doubt. But if both sides of the doubt lead to invalidity of the prayers such as if he/she doubts in a 4 Rak-ats prayers whether he/she has performed 3 or 5 Rak-ats, his/her prayers would be void.
279 - If a person doubts, after the time for prayers has already passed, as to whether he/she has offered the prayers or not, or if he/she suspects that he/she may not have offered it, it is not necessary for him/her to offer that prayer. If, however, he/she doubts before the expiry of the time for that prayer, as to whether or not he/she has offered it, he/she should offer it, even if he/she has a feeling that he/she might have done so.
280 - In cases where Salat-e-Ihtiyat is obligatory, for example if a person doubts between 3 and 4 Rak-ats , one should stand immediatly after the Salam of prayer without breaking the preyer or without doing the act which is breaking the prayer and pronounce takbir without saying Adhan and Eghamah.
281 - The difference between Salat-e-Ihtiyat and other prayers:
* It's Niyyat should not be uttered.
* It does not have another surah besides Hamd or qunut (even if it is 2 Rak-ats).
* It should be offered silently and an obligatory precaution is that its Bismillah should also be pronounced silently.
282 - If one Rak-at of Salat-e- Ihtiyat is obligatory, one recites Tashahhud and salam after the two sajdahs and if two Rak-at is obligated, one should not recite Tashahhudand Salam in the first Rak-at, but he/she should perform another Rak-at (without Takbiratul Ehram) and recite Tashahhud and Salam in the end of the second Rak-at.
Sajdatus sahv (sajdah for forgotten Acts)
283 - Sajdatus shahv which is obligated in some cases, for example, when there is a doubt between 4 and 5 Rak-at of prayers after the second Sajdah, one should perform two sajdahs after reciting Salam and say while in the form of sitting "Bismillah wa Billah waSallallah Ala Mohammad wa Allah" or say "Bismillah wa Billah Allahomma salle alaMohammad wa al Mohammad."
But it is better that to say: