Most of the sources attribute this result to the great 9th century Indian mathematician Mahavira (or Mahaviracharya, meaning Mahavira the Teacher). However, according to Richard Askey with a reference to Henry Thomas Colebrooke the formulas have been known to another great Indian mathematician Brahmagupta already in the 7th century.
We have established these identities elsewhere in two ways. The gem of a proof that follows is due to yet another Indian mathematician Paramesvara who worked in the 15th century. This is really a beautiful