Tian yuan shu (simplified Chinese: 天元术; traditional Chinese: 天元術; pinyin: tiān yuán shù) is a Chinese system of algebra for polynomial equations. Some of the earliest existing writings were created in the 13th century during the Yuan dynasty. However, the tianyuanshu method was known much earlier, in the Song dynasty and possibly before.