The Yoga Shikha Upanishad probably originated from the 13th century. This extract from the first chapter perhaps present the earliest known tantric view of Hatha yoga and Raja yoga. This Upanishad is also the oldest text in which the two terms are defined.

Upanishads

Raja yoga described as the union of male semen (Retas (रेतस्, Retas)) with female vaginal secretion (Rajas (रजस्, Rajas)) (YSU I.137).This interpretation of Raja yoga was often literally translated particularly in tantric Kaula (कौल, Kaula) schools. In other tantric traditions, Raja-Yoga (रजयोग, Raja-Yoga) is often translated as the union of Shiva (शिव, Śiva) and Shakti (शक्ति, Śakti), the male and female beings.Modern interpretations of the term Raja yoga usually gloss over these tantric ideas.

Yoga-Shikh[a]-{O}[U]panishat

Sentence 129

kathitam tu tava pritya hyetadabhyasalaksanam |"
mantro layo hatho raja-yogo.antarbhumikah kramat ||129||

कथितं तु तव प्रीत्या ह्येतदभ्यासलक्षणम् ।"
मन्त्रो लयो हठो राजयोगो.अन्तर्भूमिकाः क्रमात् ॥१२९॥

kathitaṁ tu tava prītyā hyetadabhyāsalakṣaṇam ।"
mantro layo haṭho rāja-yogo.antarbhūmikāḥ kramāt ॥129॥

...|
Walk through the inner stages of Mantra-, Laya-, Hatha- and Raja-Yoga, ||129||


mantrah (मन्त्रः, mantraḥ) = Mantra Yoga, Holy Verse,
layah (लयः, layaḥ) = Laya Yoga, dissolving
hathah (हठः, haṭhaḥ) = Hatha Yoga
raja-yogah (राजयोगः, rāja-yogaḥ) = Raja Yoga
antar (अन्तर्, antar) = internal, inner
bhumikah (भूमिकाः, bhūmikāḥ) = Stage, Rank, Level
kramat (क्रमत्, kramat) = walk, go