Bhagavad Gita 5.20
He who knows and lives in the Absolute remains unmoved and unperturbed; he is not elated by pleasure nor depressed by pain.
न प्रहृष्येत्प्रियं प्राप्य नोद्विजेत्प्राप्य चाप्रियम्।
स्थिरबुद्धिरसम्मूढो ब्रह्मविद्ब्रह्मणि स्थितः॥na prahṛṣyetpriyaṃ prāpya nodvijetprāpya cāpriyam|
sthirabuddhirasammūḍho brahmavidbrahmaṇi sthitaḥ||
English translation (above): Shri Purohit Swami (1935), public domain. Sanskrit text via github.com/gita/gita (Unlicense).