The Xixue zhong yuan (西學中源 Chinese origin of Western learning) theory was very popular and influential during the reign of Emperor Kangxi (康熙, 1662-1723). In this paper, the author uses new Chinese and Western sources to discuss the origin and development of this theory within its social context, and analyzes its relationship with the science, religion and politics of that period. First, an attempt is made to determine when Emperor Kangxi proposed this theory. Next follows a discussion of the study on the Yijing (易經) undertaken by the French Jesuit Joachim Bouvet on behalf of the emperor, as well as Bouvet's policy of accommodation regarding the spread of Christianity in China. This information will help us understand why emperor Kangxi supported the Xixue zhong yuan theory. The paper then analyzes the emperor's reasons for proposing the view that Western algebra originated in the East. In conclusion, the author discusses the Xixue zhong yuan theory from a historical perspective, based on records of Sino-Western cultural exchanges in the 17th and 18th centuries.