When **Li Rui** was a young boy, about sixteen years old, he studied Cheng Dawei's *Suanfa tong zong (General source of computational methods)* written in 1592. We give some information in Cheng Dawei's biography about this work from which Li Rui gained his mathematical expertise. In 1788 he graduated from the Yuanhe province school and went on to study mathematics at the Ziyang Academy in Suzhou.

At the Ziyang Academy Li Rui was taught mathematics by the director of the Academy, Qian Daxin (1728-1804). Qian Daxin wrote a commentary on the *San Tong Li* and, in 1791, Li Rui wrote a postscript to this work by his teacher. It was the first of many postscripts which he would write. In 1795 Ruan Yuan became a minister in the Education Department of Zhejiang province. He was based in Hangzhou and had an ambitious programme to compile a massive work of biography on mathematicians and astronomers. He gathered a team round him to undertake this task and two members of the team were Qian Daxin and Li Rui.

Li Rui now undertook a number of important tasks. He wrote a commentary on the *Ce yuan hai jing* which he completed in 1797. The original work by Li Zhi on inscribed and circumscribed circles had been written in 1248. Li Rui also wrote a commentary on another of Li Zhi's works, namely *Yi gu yan duan (New steps in computation)* which was originally written in 1259. Around the same time he studied the *Shu Shu Jiu Zhang* (Mathematical Treatise in Nine Sections). This was a work by Qin Jiushao which presents a general algorithm for the solving simultaneous congruences, that is the Chinese remainder theorem.

From 1795 when he went to assist Ruan Yuan in Hangzhou until the *Chouren zhuan* or *Biographies of astronomers and mathematicians* was published in 1799 Li Rui contributed to the work and to several other works. In addition to those listed above, he wrote the *Hu Shi Suan Shu Xi Cao* (Commentary of Calculations of Arcs and Segments), the *Zhong Ke Ce Yuan Hai Jing Xi Cao,* and the *Ri Fa Shuo Yu Qiang Ruo Kao* (Studies of Denominator of Tropical Year).

Jiao Xun was another mathematician working with Ruan Yuan in Hangzhou on the biographies compilation. After the compilation was completed Li Rui and Jiao Xun studied mathematics together around 1800. Li Rui continued to contribute to commentaries produced by others, and in 1802 he wrote a postscript to *Commentary of Qi Gu Suan Jing* by Zhang Dunren (1754-1834). Although the name of Li Rui's wife is not known, we do know that she died in the year he wrote this postscript.

Li Huang was one of the commentators on the *Nine Chapters on the Mathematical Art.* He lived in Beijing and when Li Rui went there in 1810 to take civil service examinations, he lived in Li Huang's home. Li Rui failed his examinations, but he made an important discovery in Li Huang's home for there he found a copy of the *Yang Hui Suan Fa* ("Yang Hui's Method of Computation"). This was a copy of commentary of a book originally written in 1275 which had been lost. Finding the book was a great thrill to Li Rui who published it in 1814 with a postscript written by himself.

In 1813 while working on his edition of the lost work by Yang Hui, Li Rui wrote the *Kai Fang Shuo* (Theory of Equations of Higher Degree). He was a highly productive mathematician at the height of his abilities, making very useful contributions to Chinese mathematics, when sadly he died in 1817.

**Article by:** *J J O'Connor* and *E F Robertson*