trai-vidyā māḿ soma-pāḥ pūta-pāpā
yajñair iṣṭvā svar-gatiḿ prārthayante
te puṇyam āsādya surendra-lokam
aśnanti divyān divi deva-bhogān

Translation of Bhagavad Gita 9.20

Those who study the Vedas and drink the soma juice, seeking the heavenly planets, worship Me indirectly. Purified of sinful reactions, they take birth on the pious, heavenly planet of Indra, where they enjoy godly delights.

Commentary by Sri A.C. Bhaktivedanta Swami Prabhupada of Gaudiya Sampradaya:

The word trai-vidyah refers to the three Vedas—Sama, Yajur and Rig. A brahmana who has studied these three Vedas is called a tri-vedi. Anyone who is very much attached to knowledge derived from these three Vedas is respected in society. Unfortunately, there are many great scholars of the Vedas who do not know the ultimate purport of studying them. Therefore Krishna herein declares Himself to be the ultimate goal for the tri-vedis. Actual tri-vedis take shelter under the lotus feet of Krishna and engage in pure devotional service to satisfy the Lord. Devotional service begins with the chanting of the Hare Krishna mantra and side by side trying to understand Krishna in truth. Unfortunately those who are simply official students of the Vedas become more interested in offering sacrifices to the different demigods like Indra and Candra. By such endeavor, the worshipers of different demigods are certainly purified of the contamination of the lower qualities of nature and are thereby elevated to the higher planetary systems or heavenly planets known as Maharloka, Janoloka, Tapoloka, etc. Once situated on those higher planetary systems, one can satisfy his senses hundreds of thousands of times better than on this planet.

Commentary by Sri Vishvanatha Chakravarthi Thakur of Gaudiya Sampradaya:

Those devotees who worship me through those three methods, and know me as the Supreme Lord, become liberated. But those who follow material karma do not become liberated. This is explained in two verses. Those who study and know the three Vedas, rk, yajur, and sama, or those who are absorbed in the karmas described in those three Vedas, not knowing that Indra and other devatas are my forms alone, and consequently worship me (indirectly) through worshipping those forms (mam istva), drink the remnants of the  sacrifice (soma pah), and thus attain punya.

Commentary by Sri Ramanuja of Sri Sampradaya:

9.20 The three Vedas consist of the Rk, Yajus and Saman. The followers of the three Vedas are called ‘Trai-vidyah’, but they are not devoted to Vedanta (or Trayyanta). The great souls, who rely on Vedanta, know Me, as mentioned before, to be the only object to be known from all the Vedas. Considering Me as the highest object of attainment, they worship Me through singing My names etc., caused by deep devotion to Me, and also through the sacrifice of knowledge. But the followers of the three Vedas drink the Soma beverage, forming the remainder of sacrifices in honour of Indra and other divinities, as prescribed by the Vedas. They are thereby purified of evil that stand in the way of attainment of heaven. In these sacrifices, in which Indra etc., are regarded as divinties, they really worship Me in the forms of these divinities. They ‘however’ do not know that I abide in them in that way, and so they pray for the way to heaven etc. After attaining the world of Indra, which is free from unhappiness, they enjoy everywhere the divine pleasures.

Commentary by Sri Sridhara Swami of Rudra Sampradaya:

In summarisation it has been shown in verses 11 and 12 beginning avajananti mam mudha meaning the fools deride the Supreme Lord. People who worship demigods and other lesser gods with the hope of getting quick results do not respect Lord Krishna and regard Him with esteem, thereby the fit into the class of non-devotees as previously described. But in verse 13 beginning mahatmanas tu mam meaning the great devotees of Lord Krishna are being described. Those who omit in their lifetime to worship and propitiate the Supreme Lord Krishna or any of His authorised avatars or incarnations and expansions as revealed in the Vedic scriptures it is inevitable that they are bound to samsara or unlimited cycles of birth and death perpetually.

Here is stated trai-vidya or the knowers of the Rig, Sama and Yajur Vedas as well as the Atharva Veda are cognisant of the ultimate truth. Because they study to know the knowledge of the ultimate truth and they are devoted to the rituals enjoined and prescribed in the Vedic scriptures. Worship of the demigods as prescribed in the Vedas is still in fact worshipping the Supreme Lord indirectly as they are His different part and parcels. Yet by such worship they receive the soma-pah or remnants of such offerings and from this very act are purified of all dross and cleansed from all taint and having accumulation of merit and praying earnestly for access to heaven, as a result of their virtuous deeds they experience excellent, celestial enjoyments of the demigods for a duration of longevity.

Commentary by Sri Madhvacharya of Brahma Sampradaya:

Sri Madhvacharya did not comment on this sloka.

Commentary by Sri Keshava Kashmiri of Kumara Sampradaya:

Previously Lord Krishna has illustrated the respective repercussions concerning the nature of the non-believers and the demoniac who are opposed to divinity and everything godly. Later it could be understood from that description that the Supreme Lord’s grace only flows to the mahatmanas or great beings who have dedicated themselves to incessantly acquiring knowledge about Him and are only interested in performing bhakti or loving devotion to Him. Now in this verse and the next He presents the rewards for those who are not devotees but are not opposed to divinity and who follow karma-kanda or performing meritorious actions for the sake of reaping heavenly rewards. Such votaries hankering for entry to Swargaloka or the celestial realms to enjoy exquisite heavenly delights worshipping the demigods as prescribed in the three Vedas. This is what is known as trai- vidya and applies to anyone who has self orientated motives for performing the injunctions of the Rig Veda, Sama Veda, Yajur Veda as well as the Atharva Veda. Such a person is devoted to performing Vedic rituals for personal gain and not as a spiritual practice as enjoined in the Upanisads and other Vedic scriptures. So they perform worship and adoration to Indra the chief of the demigods and other celestials even lesser than him by such rituals never realising that it is the Supreme Lord Krishna who alone sanctions whatever has been bequeathed. Still in consequence of being dedicated to performing Vedic rituals they become purged of all sins which are no longer an obstruction for entry into Swargaloka where they receive the full measure of their merits and are rewarded with heavenly pleasures and enjoyments until their accumulated merit has expired.

Commentary by Sri Adi Shankaracharya of Advaita Sampradaya:

9.20 Those, again, who are ignorant and desirous of pleasures, trai-vidyah, who are versed in the three Vedas, who know the Rk, Yajus and Sama Vedas; somapah, who are drinkers of Soma; and who, as a result of that very drinking of Soma, are puta-papah, purified of sin; prarthayante, pray for; the svargatim, heavenly goal, the attainment of heaven-heaven itself being the goal [Ast. adds this portion-svareva gatih, heaven itself being the goal.-Tr.]-; istva, by worshipping; mam, Me, existing in the forms of gods such as the Vasus and others; yajnaih, through sacrifices such as the Agnistoma etc. And asadya, having reached; surendra-lokam, the place (world) of the kind of gods, of Indra; (which is) punyam, the result of righteousness; te, they; asnanti, enjoy; divi, in heaven; the devyan, divine, heavenly, supernatural;; deva-bhogan, pleasures of gods.

Commentary by Sri Abhinavagupta of Kaula Tantra Sampradaya:

9.20-21 Traividyah etc. Te tam etc. Of course, they worship Me (Vasudeva) alone. However, the action [like sacrifice] is limited (or is known [to them]) by their aspiration for heaven only. Hence, on account of the weakness is their own being (sattva), they condition the action solely by the result of the heaven. That is why their religious act leads to rebirth and thus they attain the state of going and coming. But [on that account] it is not the inherent nature of the sacrifice to beget rebirth. For instance :

Sanskrit Shloka Without Transliteration Marks:

trai-vidya mam soma-pah puta-papa
yajñair istva svar-gatim prarthayante
te punyam asadya surendra-lokam
asnanti divyan divi deva-bhogan

Sanskrit to English Word for Word Meanings:

trai-vidyāḥ — the knowers of the three Vedas; mām — Me; soma-pāḥ — drinkers of soma juice; pūta — purified; pāpāḥ — of sins; yajñaiḥ — with sacrifices; iṣṭvā — worshiping; svaḥ-gatim — passage to heaven; prārthayante — pray for; te — they; puṇyam — pious; āsādya — attaining; sura-indra — of Indra; lokam — the world; aśnanti — enjoy; divyān — celestial; divi — in heaven; deva-bhogān — the pleasures of the gods.