"And his spirit was troubled" (Genesis 41:8). And further on it says, "and his spirit was troubled" (Daniel 2:1, in the intensified form). This one, who knew the dream, of him it is written va-tippa'em rucho (his spirit was troubled, in the lighter form); and that one, who did not know the dream, of him it is written va-titpa'em (his spirit was greatly troubled, in the intensified form), because he had forgotten the dream and its interpretation. Another interpretation: Here, since they came to give greatness to Joseph, who is one, it is written of him va-tippa'em: for he knew the dream but forgot the interpretation. Another interpretation: The dream that came toward morning, of it is said va-tippa'em; and further on, where the dream came from the time of evening, it is written of it va-titpa'em. "And he called for all the magicians of Egypt" (Genesis 41:8). They did interpret, but because their interpretation did not settle upon his heart—for he had seen the interpretation and the dream—everything they would interpret, Pharaoh would answer them, "The matter is not so." And what did they interpret? The seven good cows—seven daughters you will beget; the seven bad cows—seven daughters you will bury. The seven good ears—seven provinces you will conquer; the seven bad ears—seven provinces will rebel against you. This is what is written, "A scoffer seeks wisdom and finds none" (Proverbs 14:6)—these are the magicians; "but knowledge is easy to one who has understanding" (ibid.)—this is Joseph, peace be upon him.
Why Pharaoh's Spirit Was Troubled and the Magicians Failed
Midrash Aggadah, Genesis 41:8
ותפעם רוחו. ולהלן אומר ותתפעם רוחו (דניאל ב א), זה שידע החלום כתיב ביה ותפעם רוחו, וזה שלא ידע החלום כתיב ביה ותתפעם, מפני ששכח החלום והפתרון: ד"א הכא כיון שבאו ליתן גדולה ליוסף שהוא אחד כתיב ביה ותפעם, שידע החלום ושכח הפתרון: ד"א החלום שהיה לעת בקר, נאמר בו ותפעם, ולהלן שהיה החלום מעת ערב, כתיב ביה ותתפעם: ויקרא את כל חרטומי מצרים. פותרין היו, אלא מפני שלא היה פתרונם מתיישב על לבו, כי ראה הפתרון והחלום, וכל מה שהיו פותרין היה פרעה משיבם לא כן הדבר, ומה היו פותרין, שבע פרות הטובות, שבע בנות הוא מוליד, שבע פרות הרעות שבע בנות הוא קובר. שבע השבלים הטובות, שבע אפרכיות אתה כובש. שבע השבלים [הרעות], שבע אפרכיות מורדות בך. הדא הוא דכתיב בקש לץ חכמה ואין (משלי יד ו), אלו החרטומים, ודעת לנבון נקל (שם), זה יוסף ע"ה: