The Talmud
ברכות דף מ״וBerachot 46b
Amud b of Berachot 46 — the second side of the page
English rendering prepared for The Gematria — not a historical translation.
Berakhot 46b · ברכות מ״ו ב
ויש מהן שחותם בהן בברוך ואין פותח בברוך והטוב והמטיב פותח בברוך ואין חותם בברוך מכלל דברכה בפני עצמה היא
— and there are among them those which one seals with "Blessed" and does not open with "Blessed". And "who is good and does good" one opens with "Blessed" and does not seal with "Blessed": from this it follows that it is a blessing standing in its own right.
ואמר רב נחמן בר יצחק תדע דהטוב והמטיב לאו דאורייתא שהרי עוקרין אותה בבית האבל כדתניא מה הם אומרים בבית האבל ברוך הטוב והמטיב ר"ע אומר ברוך דיין האמת
And Rav Nachman bar Yitzchak said: you may know that "who is good and does good" is not by Torah law, for they uproot it in the house of the mourner, as it was taught: what do they say in the house of the mourner? "Blessed is He who is good and does good." Rabbi Akiva says: "Blessed is the true Judge."
הטוב והמטיב אין דיין אמת לא אלא אימא אף הטוב והמטיב
"Who is good and does good" — yes; "the true Judge" — no? Rather, say: also "who is good and does good".
מר זוטרא איקלע לבי רב אשי איתרע ביה מלתא פתח ובריך הטוב והמטיב אל אמת דיין אמת שופט בצדק לוקח במשפט ושליט בעולמו לעשות בו כרצונו כי כל דרכיו משפט שהכל שלו ואנחנו עמו ועבדיו ובכל אנחנו חייבים להודות לו ולברכו גודר פרצות בישראל הוא יגדור את הפרצה הזאת בישראל לחיים
Mar Zutra happened to come to the house of Rav Ashi. A misfortune had befallen him there. He began and blessed: who is good and does good, God of truth, true Judge, who judges in righteousness and takes away in justice, and who rules in His world to do in it as He wills; for all His ways are justice, for all is His, and we are His people and His servants, and in all things we are bound to give thanks to Him and to bless Him. He who repairs the breaches in Israel, may He repair this breach in Israel for life.
Talmud Bavli, Wikisource edition, via Sefaria — CC BY-SA 4.0. English rendering prepared for The Gematria — not a historical translation.