Śrīmad-Bhāgavatam · Text 8.2.31
Who is speaking and story frame
इत्थं गजेन्द्र: स यदाप सङ्कटं
प्राणस्य देही विवशो यदृच्छया ।
अपारयन्नात्मविमोक्षणे चिरं
दध्याविमां बुद्धिमथाभ्यपद्यत ॥ ३१ ॥
itthaṁ gajendraḥ sa yadāpa saṅkaṭaṁ
prāṇasya dehī vivaśo yadṛcchayā
apārayann ātma-vimokṣaṇe ciraṁ
dadhyāv imāṁ buddhim athābhyapadyata
When the King of the elephants saw that he was under the clutches of the crocodile by the will of providence and, being embodied and circumstantially helpless, could not save himself from danger, he was extremely afraid of being killed. He consequently thought for a long time and finally reached the following decision.
Read Śrīla Prabhupāda's purport on Vedabase.io