Li Shanlan's name is often written as Li Shan-lan. He was the greatest Chinese mathematician of the 19th century. He was born into a fairly important, highly educated family from the Zhejiang province who employed a leading philologist, Chen Huan, to educate their children on the classics. Li had a brother, Li Xinmei who also became a fine mathematician.
There are two slightly different versions of how Li first came upon mathematics. One suggests that when he was eight years old he found a copy of the Nine Chapters on the Mathematical Art in the library of a private school. He studied it on his own and mastered it without difficulty. The second version suggests that when Li was 10 years old, he studied the Nine Chapters on the Mathematical Art under his family tutor. It does seem certain then that he was in love with mathematics after studying the Nine Chapters.
In 1825, when he was fourteen years old, Li studied the first six books of Euclid's Elements, which had been translated into Chinese in 1607 by Xu Guangqi and Matteo Ricci. He continued his studies of the classics and of mathematics and several years later traveled to Hangzhou to give his examinations. Although he failed the examinations, the trip to Hangzhou was extremely valuable, for there he purchased two textbooks of mathematics. One was the Ce yuan hai jing (Sea mirror of circle measurements), originally written by Li Zhi in 1248, which was of fundamental importance in the development of Chinese algebra. The other was Gougu geyuan ji which was a trigonometry text written by Dai Zhen, who is famous as an editor of the Nine Chapters on the Mathematical Art, and had been appointed as an editor for compiling an encyclopedia of knowledge by Emperor Qianlong in 1773.
The "tian yuan" or "coefficient array method" or "method of the celestial unknown" of setting up equations, which Li learnt from Li Zhi's famous text, had a huge influence on him and he began to push these algebraic techniques forward and solved a whole variety of new problems. Although he had been largely self-educated in mathematics, Li now made contact with others who had the same interests. He wanted to make a career for himself in mathematics, but at this time in China, the subject was not considered of sufficient importance that one could make a living as a professional mathematician. The best way for a scholar is to earn his living, yet have sufficient time to push forward his research, was to be employed as a private tutor. This was the route Li was forced to take and he was fortunate to be employed in 1845 by a family who had a deep love of education. He now moved in circles which included others with similar interests in mathematics to his own and exchanging ideas proved fruitful as he pushed forward his research.