The Bhagavad Gita ('Song of the Lord') is part of the Mahabharata and also contains extensive teachings on Yoga. According to According to Mallinson and Singleton, the Gita "seeks to appropriate yoga from the renunciate milieu in which it originated, teaching that it is compatible with worldly activity carried out according to one's caste and life stage; it is only the fruits of one's actions that are to be renounced." In addition to an entire chapter (ch. 6) dedicated to traditional yoga practice, including meditation, it introduces three prominent types of yoga:
The spiritual sense of the word yoga first arises in Epic Sanskrit, in the second half of the 1st millennium BCE, and is associated with the philosophical system presented in the Yoga Sutras of Patanjali, with the chief aim of "uniting" the human spirit with the Divine. The term kriyāyoga has a technical meaning in the Yoga Sutras (2.1), designating the "practical" aspects of the philosophy, i.e. the "union with the supreme" due to performance of duties in everyday life.
According to Pāṇini, the term yoga can be derived from either of two roots, yujir yoga (to yoke) or yuj samādhau ("to concentrate"). In the context of the Yoga Sutras of Patanjali, the root yuj samādhau (to concentrate) is considered by traditional commentators as the correct etymology. In accordance with Pāṇini, Vyasa who wrote the first commentary on the Yoga Sutras, states that yoga means samādhi (concentration).
Yoga may have pre-Vedic elements. Some state yoga originated in the Indus Valley Civilization. Marshall, Eliade and other scholars note that the Pashupati seal discovered in an Indus Valley Civilization site depicts a figure in a position resembling an asana used for meditation, Mulabandhasana. This interpretation is considered speculative and uncertain by more recent analysis of Srinivasan and may be a case of projecting "later practices into archeological findings".
The Yoga Sutras are also influenced by the Sramana traditions of Buddhism and Jainism, and may represent a further Brahmanical attempt to adopt yoga from the Sramana traditions. As noted by Larson, there are numerous parallels in the concepts in ancient Samkhya, Yoga and Abhidharma Buddhist schools of thought, particularly from 2nd century BCE to 1st century AD. Patanjali's Yoga Sutras is a synthesis of these three traditions. From Samkhya, the Yoga Sutras adopt the "reflective discernment" (adhyavasaya) of prakrti and purusa (dualism), its metaphysical rationalism, as well its three epistemic methods of gaining reliable knowledge. From Abhidharma Buddhism's idea of nirodhasamadhi, suggests Larson, Yoga Sutras adopt the pursuit of altered state of awareness, but unlike Buddhism's concept of no self nor soul, Yoga is physicalist and realist like Samkhya in believing that each individual has a self and soul. The third concept Yoga Sutras synthesize into its philosophy is the ancient ascetic traditions of meditation and introspection, as well as the yoga ideas from middle Upanishads such as Katha, Shvetashvatara and Maitri.