Xuancao comes from shijing 诗经 [The Book of Songs]: “焉得谖草,言树之背” (Where can I get xuancao to plant it in the north room?). The xuancao 谖草 above refers to xuancao 萱草.
According to bencao gangmu 本草纲目 [Compendium of Materia Medica], xuancao is also called wangyoucao 忘忧草, because it helps people get rid of their concerns by planting it as a way to forget their worries.
According to maoshigu xunzhuan 毛诗诂训传, bei 背 refers to beitang 北堂 [north room], which was mainly the room for mother in ancient China. Therefore, over time, the sentence yande xuancao, yansu zibei 焉得谖草,言树之背” carried the meaning that to plant xuancao in one’s mother’s room was to dispel a mother’s worries. “A room with xuancao” is usually used to refer to the mother’s room and mother. In this context, xuantang refers to Madam Liu, the nominal mother of Yanyu.