In al-Mughni 2/537-538, ibn Qudaamah said, "It is best to perform the optional prayer during the day in sets of two rak'ats. This is because 'Ali ibn 'Abdillah al-Baariqi transmitted on the authority of ibn 'Umar, on the authority of 'Umar who transmitted from the Prophet (peace be upon him) that he said, "The (optional) prayer of night and day is performed in sets of two rak'ats." This hadeeth was transmitted by Aboo Dawood and al-Athram. Performing prayer in this manner protects against forgetfulness, and this is similar to the manner in which the optional prayers at night are performed, and the manner in the Prophet (peace be upon him) performed the optional prayer. Based on the hadeeth above al-Hasan, Sa'eed ibn Jubayr, Maalik, ash-Shaafi'ee and Hammaad ibn Sulaymaan were of the opinion that the optional prayer of the day and night is offered in sets of two rak'ats. The preponderant opinion is that if a person makes an optional prayer of four rak'ats, then his prayer is valid. This was the opinion of ibn 'Umar. Ishaaq used to say, "My opinion is that the optional prayer of the day should be performed in sets of four rak'ats. However, it is permissible for a person to perform two rak'ats. This opinion was similar to that of al-Awzaa'ee and the rationalist scholars. This was based on what was transmitted on the authority of Aboo Ayyoob who narrated that the Prophet (peace be upon him) said, " The gates of heaven are opened for four rak'ahs containing no taslim (salutation) in their middle before the noon prayer." This hadeeth was transmitted by Aboo Dawood.
Moreover, the implied meaning of the Prophet's statement: "The prayer of the night is performed in sets of two rak'ats," is that the prayer of the day is four rak'ats. My view is that the preponderant opinion is that the prayer of the day should be performed in sets of two rak'ats because of the reasons mentioned above. The hadeeth of Aboo Ayyoob was transmitted by 'Ubaydullah ibn Mut'ib, and he is a weak narrator. The implied meaning of the other hadeeth which is agreed upon indicates that it is permissible to perform the optional prayer in sets of four, and it does not indicate that it is better. As for the hadeeth of al-Baariqi; he was the only narrator who transmitted the word "the day". The hadeeth was transmitted on the authority of ibn 'Umar by approximately twenty-five narrators, and none of them mentioned the word "the day" except al-Baariqi. Ibn 'Umar used to perform four rak'ats of optional prayer, and this indicates that the hadeeth which was transmitted from him concerning two rak'ats is weak, or that the hadeeth means that it is virtuous to perform the optional prayer of the day in sets of two rak'ats, although it is permissible to perform four rak'ats. And Allah knows best.
In al-Majmoo' Sharh al-Muhaththab 3/549-550, An-Nawawi said, "Our mathab, that is the Shaafi'te mathab is that it is best to make the tasleem after every two rak'ats in the optional prayer of the day and night. Ibn al-Munthir stated that this was the opinion of al-Hasan al-Basri, Sa'eed ibn al-Jubayr, Hammaad ibn Abi Sulaymaan, Maalik, and Ahmad. This opinion was chosen by ibn al-Munthir. It was transmitted from ibn 'Umar and Ishaaq ibn Raahawayhi that it is best to perform four raka'ts during the day. Al-Awzaa'ee and Aboo Haneefah said, "The prayer of the night is performed in sets of two, and if a person wishes he may offer the optional night prayer in sets of four rak'ats. " My proof is the hadeeth which was mentioned previously, and it states, "The (optional) prayer of the night and day is performed in sets of two rak'ats. This hadeeth is authentic as I have mentioned above. The fact that the optional prayers of the day are performed in units of two rak'ats is supported by innumerable authentic hadeeths like the hadeeth which states, "two rak'ats before Zuhr, and two rak'ats after it." Likewise, two optional rak'ats of prayer may be offered before 'Asr, after Maghrib, and after 'Isha. This was also mentioned in the hadeeth which mentions the two rak'ats of the Duha prayer, the tahiyyatul masjid, the two rak'ats of the istikharah prayer, the two rak'ats after wudoo, and so on. As for the hadeeth which was reportedly transmitted by Aboo Ayyoob from the Prophet (peace be upon him) that he said, "The gates of heaven are opened for four rak'ats containing no taslim (salutation) in their middle before the noon prayer," the scholars agreed about its weakness. The scholars who graded the hadeeth as weak include Yahya ibn Sa'eed al-Qattaan, Aboo Dawood and al-Bayhaqi. The hadeeth revolves around 'Ubaydah ibn Mut'ib, and he was a weak narrator. And Allah knows best.