Source: Mahabharata Vana Parva, Mahabharata Tatparya Nirnaya Chapter 22
In the Vana Parva of the Mahabharata, the story of the Pandavas and Draupadi spending 1 year in disguise in the Kingdom of Virata is covered. Yudhisthira disguises himself as a monk, Bhimasena as a cook, Draupadi as an assistant to the queen, and Nakula and Sahadeva as Gopala and Ashwapala. But Arjuna disguises himself as a Shanda (transgender) and teaches music and dance to Uttaraa, the daughter of Virata. It is interesting to know why Arjuna had to take up this guise, especially because the Pandavas had boons from Yama and Durga that they would never get discovered during their 13th year, irrespective of how they appeared. So why did Arjuna become Bruhannala?
The answer lies in the incident that occurs during the Tirthayatra that Arjuna undertakes in the Vana Parva. Arjuna decides to obtain divine Astras to become prepared to face Bhishma and Drona in the war. Lord Veda Vyasa gives Yudhisthira a mantra which he advices to Arjuna. Arjuna prays to Shiva with the same and obtains the Pashupataastra. At the same time, various devatas appear in front of Arjuna and grant him divine weapons. Indra too blesses Arjuna, gives him astras and invites him to Swarga Loka.
Indra sends his divine chariot along with his charioteer Matali and Arjuna enters Swarga even when he still has the body of a human being. Arjuna spends 5 years in Swarga Loka. One day, Indra and Arjuna are watching the dance of the apsara Urvashi. Indra notices Arjuna staring at her and sends her to him. Urvashi approaches Arjuna and asks for acceptance. Arjuna bows to her and tells her that he was staring at her only from the point of view of a mother. He tells her that he is born in the race of King Puru who has descended from Puroorava and Urvashi. Hence, she is mother-like for him. Urvashi is not impressed by this great Brahmacharya and Indriya Nigraha displayed by Arjuna. She curses him that he should turn into a Shanda (transgender).
Indra intervenes at this stage and modifies the curse. He tells Arjuna that he will have to spend one year acting as a Shanda. Thus, Arjuna ends up spending the Ajnaatavasa period of one year as a Shanda.
Another question that arises in the disguise period is related to Arjuna teaching music and dance to Uttaraa. How did Arjuna qualify in these two fields. A very interesting episode answers this question as well.
Earlier, during the immediate aftermath of the wax palace incident, the Pandavas travel through a dense forest once. Since it was the middle of the night, a Gandharva named Chitra Ratha stops them and warns them that he will kill all of them for tresspassing at such an odd time. Arjuna counters the Gandharva and, after an argument, the two start fighting each other. Arjuna uses a version of the Agneyaastra on him. The astra burns the entire skin of the Gandharva turning him black but causes no internal burn injuries at all! The Gandharva is surprised at the supreme power of this astra and begs for Arjuna’s forgiveness and asks him to teach him the astra. Arjuna immediately obliges. The Gandharva then requests Arjuna to acquire some special skills from him. Arjuna refuses saying that he doesn’t want to barter knowledge in this way and promises to learn something from him later.
During his stay in Swarga, Arjuna learns music, dance and other Gandharva skills from the same Gandharva Chitraratha. Thus, Arjuna becomes an extremely skilled musician who is able to teach the Princess Uttaraa.