And it appears to me that the primary view is like the words of that great authority. For behold, our teacher, the Beit Yosef, in his great work in Orach Chaim siman 554, brought a responsum of the Maharil regarding the matter of Tisha B'Av, that to study with depth is much better, see there. And according to this, since he is studying with depth and is a great man, it is inevitable that some chiddushei Torah will be innovated by him, and it is permitted to write them down so that he does not forget. And you have no greater "davar ha'aved" than this, just as one of the great authorities permitted writing chiddushei Torah on Chol HaMoed for this reason (Taz Orach Chaim end of siman 545). And if it is because of joy—this is a joy that comes of its own accord. And what shall the mourner do if his businesses earned him much money, and against his will the heart rejoices? Or if his wife gave birth to a male child and he is joyful? And what shall the mourner do regarding the joy of a mitzvah, such as when he dons tefillin or prays with kavvanah if he has reached this level? And in the donning of tefillin there is also joy, as the students of our teacher Yonah wrote at the beginning of the chapter "Ein Omdin." And they only prohibited the mourner from performing an act of joy ab initio, such as the study of Torah which is the essence of joy. But that which they permitted to him and the joy comes of its own accord—it was never prohibited. And certainly, to sit ab initio to study some pilpul regarding mourning or on Tisha B'Av in the matters that were permitted to him—is prohibited, as the Acharonim wrote in Orach Chaim siman 554 (Taz subsection 2, and Magen Avraham subsection 5, see there). But when the chiddush is formed from the side of the study, what is he to do? Consider for yourself: the Book of Iyov was permitted to a mourner, and you have no book more obscure than Iyov, and now if he is studying and a good explanation of some verse is innovated by him, shall he withhold himself from this? This is nothing but astonishing. And so it appears to me as the primary law.
ולי נראה עיקר כדברי אותו גדול. דהנה רבינו הבית יוסף בספרו הגדול באורח חיים סימן תקנ"ד (טור אורח חיים תקנד) הביא תשובת מהרי"ל לענין תשעה באב, דללמוד בעיון עדיף טפי, עיין שם. ולפי זה ממילא כיון שלומד בעיון והוא אדם גדול, בהכרח שתתחדש לו איזה חידושי תורה, ומותר לכותבם כדי שלא ישכח. ואין לך דבר האבד יותר מזה, כמו שהתיר אחד מהגדולים לכתוב חידושי תורה בחול המועד מטעם זה (ט"ז אורח חיים סוף סימן תקמ"ה (שולחן ערוך אורח חיים תקמה)). ואי משום שמחה – זהו שמחה דממילא. ומה יעשה האבל אם עסקיו הרויחו לו הרבה מעות, ובעל כרחו הלב שמח? או ילדה אשתו זכר והוא שמח? ומה יעשה האבל בשמחה של מצוה, כשמניח תפילין או מתפלל בכוונה אם הגיע למדרגה זו? ובהנחת תפילין יש גם כן שמחה, כמו שכתבו תלמידי רבינו יונה בריש פרק "אין עומדין". ולא אסרו לאבל אלא שלא יעשה לכתחילה מעשה של שמחה, כמו לימוד התורה שהיא עצם השמחה. אבל מה שהתירו לו והשמחה באה ממילא – לא נאסרה מעולם. ובוודאי לישב לכתחילה ללמוד איזה פלפול באבלות ובתשעה באב בהדברים שהותר לו – אסור, כמו שכתבו האחרונים באורח חיים סימן תקנ"ד (שולחן ערוך אורח חיים תקנד) (ט"ז סעיף קטן ב, ומגן אברהם סעיף קטן ה, עיין שם). אבל כשנתהוה החידוש מצד הלימוד, מה לו לעשות? הגע עצמך: ספר איוב הותרה לו לאבל, ואין לך ספר סתום יותר מאיוב, ועתה אם הוא לומד ונתחדש לו פירוש טוב באיזה פסוק, הימנע את עצמו מזה? אין זה אלא מן המתמיהין. וכן נראה לי עיקר לדינא.