Sheriff Michael O'Grady QC said: "In the period leading up to these events you actually researched this topic.
"You have left a young woman to suffer a terrifying ordeal and she will be physically and mentally scarred for the rest of her life."
Sheriff O'Grady said that he had no option but for Bowen to be detained for 21 months.
He also banned her from contacting Miss Young after making her the subject of a five-year non-harassment order. The court had previously heard that both girls were acquaintances and members of the school's orchestra before the incident.
But the "talented musicians" fell out when Miss Young began seeing Bowen's former boyfriend.
In a planned revenge attack, Bowen bought a bottle of drain cleaner online and hid it in her locker.
She sneaked into the school's music room where instruments are stored and poured the drain cleaner into the instrument case.
Prosecutor Aidan Higgins told the court: "When the victim went into the strings room she was aware of an eggy smell.
"She then took down her case and she was immediately aware of red liquid spilling from the bottom of the case and landing on her right leg. She looked down and saw her tights were disintegrating and she was aware of an intense burning on her leg."
The victim was taken to Edinburgh Royal Infirmary and later transferred to St John's Hospital in Livingston, West Lothian, for plastic surgery.
The court heard the girl suffers psychological problems and has nerve damage as a result of the attack.
Bowen was identified as the culprit after a schoolboy spotted her crouching down inside the deserted music room ten minutes before the incident occurred.
Yesterday, defence solicitor Jim Stephenson told the court that Bowen had recently been diagnosed with autism and was also suffering depression.
He added his young client "struggles to deal with things" but has a "supportive family" and asked for a community order to be imposed so she can be monitored.
But Sheriff O'Grady told Bowen: "You should understand there is currently a very real public concern and fear about the emergence of this awful substance. It must be plain to anyone who resorts to acid for whatever purpose the courts will not tolerate its possession or use for any criminal act.
"It is with considerable regret that I have come to the conclusion that nothing but a custodial sentence is appropriate."