You are here

The ‘Piling Up of Squares’ in Ancient China

Frank Swetz (The Pennsylvania State University)

Over the years, the journals of the National Council of Teachers of Mathematics (NCTM) have published numerous articles on the history of mathematics and its use in teaching. These journals have included Teaching Children Mathematics, Mathematics Teaching in the Middle School, and Mathematics Teacher, each of which was published through May 2019. In January 2020, these three journals were replaced by NCTM's new practitioner journal, Mathematics Teacher: Learning & Teaching PK–12 (MTLT). Thanks to the efforts of Convergence founding co-editor Frank Swetz, NCTM has allowed Convergence to republish (in pdf format) up to two articles from Mathematics Teacher annually since 2015.

One of the editors’ picks for 2020 is an article by Frank Swetz himself, in which he describes manipulative activities that were used in ancient China and could be used in current classrooms to geometrically solve algebraic problems:

Frank Swetz, “The ‘Piling Up of Squares’ in Ancient China,” Mathematics Teacher, Vol. 73, No. 1 (January 1977), pp. 72–79. Reprinted with permission from Mathematics Teacher, © 1977 by the National Council of Teachers of Mathematics. All rights reserved.

(Click on the title to download a pdf file of the article, “The ‘Piling Up of Squares’ in Ancient China.”)

Asked to reflect on his article, Prof. Swetz wrote:

It is a bit of déjà vu to re-read an article that I wrote over 40 years ago. Usually in such a situation, the author, benefiting from increased knowledge and experience, would wish to make changes. However, in the instance of re-reading my “Piling up Squares” piece, this is not the case. I am satisfied with the information supplied. It was a product of the time: I had just finished my dissertation on Mathematics Education in China, later to be published by MIT Press [Swetz 1974]. In my teacher training courses, I was extolling the merits of concrete operational teaching and discovery learning. My research left me with lingering questions concerning the scope and viability of traditional Chinese mathematics. During the early stages of Western-inspired educational reforms (1830–1920), Chinese court scholars insisted that the mathematical content being imposed upon them really had Chinese roots, whereas foreign observers at the same time commented on the poor quality of Chinese mathematics, which they criticized for being in a confused state and for not including proofs of mathematical concepts. I realized that the Chinese had a robust mathematical tradition and that in the time of its prevalence it probably exceeded that found in contemporary Europe. Further, they had didactical methods/proofs to confirm their theories. In my article, I wished to convey this information and, further, to demonstrate some of the intuitive techniques employed by the Chinese in establishing their proofs: the use of grids or squares to comprehend area and their dissection techniques to illustrate algebraic operations.

Since the appearance of my article, the available literature about Chinese mathematics has increased greatly. For example, the source of the problems selected for my article was the Chinese mathematical classic: Jiuzhang suanshu (The Nine Chapters of the Mathematical Art). This text has since been translated into English [Shen et al. 1999], and the concept of piling up squares that was employed by Chinese mathematicians has been expanded to a three-dimensional analogy, the piling up of unit cubes to form blocks, which are interpreted in numerological or geometrical contexts. In 1274 the Chinese mathematician, Yang Hui, published his findings on obtaining the sum of the series of the squares for natural numbers: 

Sn = 12 + 22 + 3+ … + n2

Yang calculated the number of objects contained in a “pile with four corners”, a large block demonstrating the sum: Sn = 1/3 n (n + 1) (n + ½).  Seventeenth-century mathematician Chen Shiren (1676–1722) compiled a text, Supplement to ‘What Width’, in which he provided formulas for 37 sums of finite series. He designated these sums as “piles”, implying the use of unit cubes in obtaining his derivations. For Yang’s series, Chen referred to the result as “square piles”. Li Shanlan, the noted nineteenth-century mathematical reformer, published a book, Duoji bilei, in which he discussed figurative numbers supported by illustrative diagrams.

Figure 1. Excerpt from Ze gu xi suan xue (Collected Mathematical Works),
showing Li Shanlan’s diagram of figurative numbers on left-hand page.
The reader should try to interpret the block diagrams.
Image taken from Convergence's Mathematical Treasures collection.

While my article discussed the “piling up of squares” in working with plane regions, the concept was expanded to the use of “piles” in exploring higher mathematical concepts. Old Chinese mathematical books supplemented their exposition with supporting pedagogical/learning techniques. There is still much to learn about Chinese mathematics.

Invited by the editors to comment on Frank’s article in honor of its reprinting, Joel Haack (University of Northern Iowa) remarked:

It was a pleasure to revisit Swetz’s article, drawn from his translation and commentary on the ninth chapter of The Nine Chapters of the Mathematical Art that appeared in his provocatively titled Was Pythagoras Chinese?, coauthored with R. I. Kao. Joseph Dauben  [2007, p. 282] notes that it was one of the two earliest translations of this chapter, both appearing in 1977, with the other by B. Gillon in Historia Mathematica. A complete translation of the Nine Chapters is now available in English, with the 1999 translation by Shen, Crossley and Lun being the standard choice.

Because Swetz’s article is based on his 1977 translation, it is perhaps not surprising that terminology and transliteration of Chinese names and terms have changed since its publication. For example, the "Chiu-chang suan-shu" is more commonly now the "Jiu zhang suan shu"; "kou-ku" is now "gou-gu"; and "shian" is "xian".

In addition to the manipulative principle “piling up of squares," discussions of these problems now include a more abstract manipulative principle: the “out-in complementary principle.” Berlinghoff and Gouvea [2015, p. 14] describe this principle as “imagining figures being cut up and moved around; because this often involved removing some pieces and putting in others, the Chinese called it the ‘out-in’ method.” Martzloff [1997, pp. 276–277] discusses it in terms of manipulating actual objects, translating a phrase of Liu Hui’s as “to piece together (or fill in) the empty using the full,” continuing “in other words, to show that a certain figure which is said to be ‘empty’ because it is not yet physically constructed has the same area or volume as a figure, said to be ‘full’, which is to be ‘unstitched’ in order to piece together the other.” Martzloff’s translation of the name of the technique on page 296 is “out-in mutual patching.”

Swetz [1992, p. 33] notes a comment by the thirteenth-century Yang Hui that “men of the past changed the names of their methods from problem to problem.” I like both expressions, “piling up of squares” and “out-in complementary principle,” to describe the proof technique; the first is more active while the second describes the intention.

Prof. Haack further provided the following list of additional references for those who wish to learn more about the history of early Chinese mathematics and its use in the classroom:

About NCTM

The National Council of Teachers of Mathematics (NCTM) is the public voice of mathematics education, supporting teachers to ensure equitable mathematics learning of the highest quality for all students through vision, leadership, professional development, and research. In addition to its practitioner journal Mathematics Teacher: Learning & Teaching PK–12 (MTLT), the council currently publishes a mathematics education research journal, as well as an online journal for teacher educators (jointly with the Association of Mathematics Teacher Educators). With 80,000 members and more than 200 Affiliates, NCTM is the world’s largest organization dedicated to improving mathematics education in prekindergarten through grade 12. For more information on NCTM membership, visit

Other Mathematics Teacher Articles in Convergence

Patricia R. Allaire and Robert E. Bradley, “Geometric Approaches to Quadratic Equations from Other Times and Places,” Mathematics Teacher, Vol. 94, No. 4 (April 2001), pp. 308–313, 319.

David M. Bressoud, "Historical Reflections on Teaching Trigonometry," Mathematics Teacher, Vol. 104, No. 2 (September 2010), pp. 106–112, plus three supplementary sections, "Hipparchus," "Euclid," and "Ptolemy."

Keith Devlin, "The Pascal-Fermat Correspondence: How Mathematics Is Really Done," Mathematics Teacher, Vol. 103, No. 8 (April 2010), pp. 578–582.

Jennifer Horn, Amy Zamierowski and Rita Barger, “Correspondence from Mathematicians," Mathematics Teacher, Vol. 93, No. 8 (November 2000), pp. 688–691.

Seán P. Madden, Jocelyne M. Comstock, and James P. Downing, “Poles, Parking Lots, & Mount Piton: Classroom Activities that Combine Astronomy, History, and Mathematics,” Mathematics Teacher, Vol. 100, No. 2 (September 2006), pp. 94–99.

Peter N. Oliver, “Pierre Varignon and the Parallelogram Theorem,” Mathematics Teacher, Vol. 94, No. 4 (April 2001), pp. 316–319.

Peter N. Oliver, “Consequences of the Varignon Parallelogram Theorem,” Mathematics Teacher, Vol. 94, No. 5 (May 2001), pp. 406–408.

Rheta N. Rubenstein and Randy K. Schwartz, “Word Histories: Melding Mathematics and Meanings,” The Mathematics Teacher, Vol. 93, No. 8 (November 2000), pp. 664–669.

Shai Simonson, “The Mathematics of Levi ben Gershon,” Mathematics Teacher, Vol. 93, No. 8 (November 2000), pp. 659–663.

Frank Swetz (The Pennsylvania State University), "The ‘Piling Up of Squares’ in Ancient China," Convergence (October 2020)