Han Dynasty to Wei-Jin period · HISTORICAL EVENT

Nine Chapters on the Mathematical Art (九章算术)

九章算术

The Nine Chapters on the Mathematical Art (九章算术), also known as the Jiuzhang Suanshu, was the foundational compilation and annotation event of China's earliest comprehensive mathematical classic, which established the theoretical paradigm of traditional East Asian mathematics between the Western Han and the Wei-Jin era. Spurred by the rapid expansion of agricultural irrigation, civil architecture, tax transport, and calendrical astronomy, scattered…

100 BCE–263 CEChang'an, Luoyang, Imperial Academy, and the Institute of Mathematics at the Directorate of Education
九章算术
Related historical visual of The Nine Chapters on the Mathematical Art
Image creditsEditor at Large · CC BY-SA 2.5Image source

OVERVIEW

The Nine Chapters on the Mathematical Art (九章算术), also known as the Jiuzhang Suanshu, was the foundational compilation and annotation event of China's earliest comprehensive mathematical classic, which established the theoretical paradigm of traditional East Asian mathematics between the Western Han and the Wei-Jin era. Spurred by the rapid expansion of agricultural irrigation, civil architecture, tax transport, and calendrical astronomy, scattered computational methods were assembled by Western Han Chancellor Zhang Cang and Grand Minister of Agriculture Geng Shouchang, culminating in a definitive canon of 246 applied problems by the first century AD. Divided into nine core chapters—Field Measurement, Millet and Rice, Proportional Distribution, Short Width, Civil Engineering, Equitable Taxes, Excess and Deficit, Equations, and Right Triangles—the text systematically established algorithms for fraction arithmetic, simultaneous linear systems, square and cube root extraction, signed number rules, and the Pythagorean theorem. In 263 AD, the mathematician Liu Hui appended his seminal commentary, inventing the exhaustion method for calculating pi and supplying rigorous deductive proofs. As the foremost work among the Ten Computational Canons, the compilation and transmission of The Nine Chapters on the Mathematical Art marked the completed architectural foundation of algorithmic science in the classical world.

EVENT TIMELINE

Zhang Cang and Geng Shouchang Edit Text

Western Han scholars compile and edit ancestral bamboo calculation manuscripts into the foundational nine-chapter format.

Definitive Han Imperial Circulation

By the early Eastern Han, The Nine Chapters on the Mathematical Art circulates as an authoritative 246-problem canon in the Imperial Academy.

Liu Hui Appends Historic Commentary

Mathematician Liu Hui completes his annotations, creating the exhaustion method for pi and establishing deductive geometric proofs.

Li Chunfeng Designates First of Ten Canons

Tang astronomer Li Chunfeng edits the text, elevating it as the primary textbook for the imperial civil mathematics examinations.

Transmission to Japan and East Asia

Japanese diplomatic embassies transmit the text to Nara, where it is adopted as the foundational manual for aristocratic university students.

Northern Song Woodblock Print Edition

The Northern Song Imperial Directorate prints the earliest woodblock edition, marking the dawn of mass mathematical book publishing.

Western Transmission via Fibonacci

The Double False Position and negative arithmetic algorithms reach Europe through Arab translations, influencing Fibonacci's Liber Abaci.

Dai Zhen Collation for Siku Quanshu

Qing scholar Dai Zhen reconstructs the lost Song edition from the Yongle Dadian, publishing the definitive modern collation.

Relationship graph

FULL ACCOUNT

Historical Background

Pre-Qin Practical Traditions and Decimal Counting Rods

Chinese mathematics originated in practical economic necessity, with bone and bronze inscriptions from the Shang and Western Zhou dynasties demonstrating decimal notation. During the Warring States period, the development of bamboo counting rods established the decimal positional value system. As ditch drainage networks expanded and iron plows replaced communal farming, parcel geometries became irregular, requiring precise measurement formulas for land taxation, granary capacity, and public corvee labor, generating the empirical algorithmic foundations of ancient mathematics.

Imperial Bureaucratic Administration and Quantitative Governance

The consolidation of the Qin and Han empires confronted the centralized court with complex logistical tasks. Registering census rolls, calculating grain transportation over thousands of miles, and standardizing uniform weights and measures demanded an authoritative national arithmetic canon for administrative clerks. The 1983 archaeological discovery of the bamboo manuscript Suan Shu Shu (Book on Numbers and Computation) at Zhangjiashan, dating to the second century BC, confirmed that the early Han bureaucracy utilized standardized textbooks covering land divisions and tax conversions, providing the textual antecedents for The Nine Chapters.

Editorial Efforts by Western Han Scholar-Statesmen

The Qin burning of books had damaged early mathematical manuscripts. Following the founding of the Han, Chancellor Zhang Cang gathered surviving Warring States bamboo slips, organizing the fragmented calculations into coherent chapters. Decades later, Imperial Counselor Geng Shouchang, an expert in astronomical calculations who oversaw national grain reserves under Emperor Xuan, expanded the compilation with practical pricing conversions. Through successive revisions by imperial scholars, ancient mathematical knowledge was systematized into an integrated classic.

Course of the Event

Pre-Qin Counting-Rod Mathematics and Pre-Han Textual Lineage

The roots of The Nine Chapters on the Mathematical Art trace back to the "Nine Numeracies" of the Western Zhou, which the Rites of Zhou classified as one of the Six Arts required of noble scholars. During the Warring States era, Mohist philosophers formulated rigorous definitions of geometric points, surfaces, and solids, while Legalist administrators compiled quantitative measures for granaries and agricultural fields.

Archaeological discoveries of Qin multiplication tables at Liye and early Han bamboo slips at Zhangjiashan demonstrate the evolutionary lineage preceding The Nine Chapters. The Suan Shu Shu contains over sixty mathematical problems structured in the standard "Problem, Answer, Method" format, featuring topical headings identical to The Nine Chapters and confirming centuries of continuous indigenous development.

Counting-rod arithmetic formed the technical backbone of this tradition. By manipulating wooden rods across a counting board according to decimal positional rules, Han mathematicians executed multidigit multiplication, division, and fractional reduction with extraordinary speed, avoiding the unwieldy alphabetic notations of Mediterranean civilizations and enabling pure algorithmic progress.

The Zhangjiashan bamboo slips detail exact legal standards for grain transactions, post-horse feed ratios, and labor hours, proving that two centuries before The Nine Chapters assumed its final form, the imperial administrative state operated on quantitative accounting principles that provided an empirical laboratory for mathematical codification.

Zhang Cang and Geng Shouchang's Editorial Compilations

According to Liu Hui's preface, ancient mathematical texts had been fractured during the Qin dynasty. Under the Western Han, Chancellor Zhang Cang undertook the first systematic collation, restoring order to damaged fragments. Zhang Cang's mastery of acoustics, calendrical cycles, and administration allowed him to refine the computational steps of the surviving problems.

During the reign of Emperor Xuan, Geng Shouchang introduced practical commercial calculations derived from his management of the imperial Ever-Normal Granary system. Geng refined the rules for tax distribution and distance freight, standardizing the text into nine topical categories. Scholars conclude that the compilation was finalized between the late Western Han and the early Eastern Han (circa 89 AD).

The finalized canon adopted an applied problem-text structure containing 246 problems. Each entry opened with the "Problem" (context and known parameters), followed by the "Answer" (numerical solution), and concluded with the "Method" (general computational algorithm), establishing an exemplary textbook format that governed East Asian mathematical writing for millennia.

Both Zhang Cang and Geng Shouchang were active in official calendrical reform, integrating sophisticated celestial calculations with worldly land surveying. The compilation process represented the conversion of confidential imperial archives into a public educational classic that bridged theoretical astronomy and practical governance.

The "Fangtian" Chapter: Field Measurement, Fractions, and Area

The opening chapter, "Fangtian" (Field Measurement), contains thirty-eight problems and twenty-one algorithms dedicated to agricultural surveying and plane geometry. It provides exact geometric formulas for rectangles, triangles, right trapezoids, isosceles trapezoids, circles, sectors, segments, and annuli, pioneering the "out-in complementary principle" for geometric dissection.

Significantly, the chapter established the world's earliest complete algorithmic rules for fractional arithmetic. It detailed reduction to common denominators, expansion, addition, subtraction, multiplication, and division, introducing the Euclidean algorithm of reciprocal subtraction to determine greatest common divisors centuries before its appearance in European arithmetic treatises.

For circular areas, the text formulated the rule: "Multiply half the circumference by half the radius to obtain the area," containing the conceptual seed of exhaustion methods. Fangtian harmoniously fused geometric mensuration with fractional algebra, resolving the foundational cadastral problems of an agrarian civilization.

In dissecting complex polygons into standard rectangles and triangles, the text established intuitive dissection proofs that avoided formalistic Euclidean axioms, adhering to the pragmatic spirit of traditional Chinese mathematics.

Grain Exchange, Proportional Distribution, and Engineering Mensuration

The second chapter, "Millet and Rice," presents forty-six problems resolving exchange rates between twenty different grains and foodstuffs. It established the "Rule of Three" (known as the Method of Present and Desired), formulating the universal proportional algorithm: "Multiply the given quantity by the seeking rate, and divide by the given rate."

The third chapter, "Proportional Distribution," formulated the arithmetic of proportional sharing and inverse proportionality. This enabled the state to divide tax quotas, corvee labor, and military expenditures among households according to property ownership, exemplifying the application of arithmetic to socio-economic equity.

The fifth chapter, "Civil Engineering," encompasses twenty-eight problems dedicated to three-dimensional volume calculations for excavations, ramparts, dykes, and granaries. It supplied precise formulas for rectangular prisms, cylinders, truncated cones, and polyhedra such as the yangma (rectangular pyramid) and bieniu (tetrahedron with right triangular faces), anticipating modern solid geometry.

These solid geometry algorithms directly guided the construction of the Great Wall, imperial fortifications, and canal excavation works, allowing engineers to calculate labor hours, earth movements, and logistics with remarkable precision.

The "Shaoguang" Chapter: Extraction of Square and Cube Roots

The fourth chapter, "Short Width," addresses the inverse problem of plane and solid mensuration: determining side lengths when total area or volume is given. To resolve these challenges, the chapter introduced the world's earliest algorithmic routines for extracting square and cube roots.

The extraction process utilized counting rods arranged in positional rows, systematically isolating digits through iterative division and subtraction akin to modern Ruffini-Horner polynomial extraction. When roots were not rational integers, the text introduced fractional approximation methods and decimal expansions.

The mastery of root extraction represented a breakthrough in solving quadratic and cubic equations. The rod configurations formulated in this chapter directly inspired the root-extraction discoveries of Jia Xian and Qin Jiushao during the Song and Yuan dynasties, forming the bedrock of high-order polynomial algebra.

By pursuing iterative numerical approximation on counting boards, Chinese mathematicians developed programmable routines that prioritized numerical results over abstract geometric constructions, anticipating the algorithmic structure of modern computing.

Taxes and Transportation, and the "Excess and Deficit" Double False Position

The sixth chapter, "Equitable Taxes," addressed the logistical fiscal policies introduced by Sang Hongyang under Emperor Wu. By synthesizing compound proportions and weighted averages, the chapter resolved multi-variable optimization problems, calculating equitable tax payments adjusted for transportation distances and terrain difficulties.

The seventh chapter, "Excess and Deficit," introduced the celebrated "Double False Position" algorithm. This method solved hidden linear and nonlinear relationships by making two arbitrary trial assumptions and analyzing their resulting deviations from balance, utilizing the formula: "Combine the excess and deficit as the divisor, multiply the assumed values by the opposite deviations, sum them as the dividend, and divide."

The Double False Position method translated implicit algebraic relationships into standardized linear interpolation routines. Transmitted westward via the Silk Road, Arab mathematicians named it the "Rule of Cathay," and its adoption by Leonardo Fibonacci in thirteenth-century Italy exerted a transformative influence on late medieval European algebra.

In civic life, the method was employed in commercial partnerships, private loans, and grain distribution, becoming an indispensable quantitative tool for merchants and imperial administrators throughout Chinese history.

The "Fangcheng" Chapter: Linear Systems and Signed Number Arithmetic

The eighth chapter, "Equations," represents the mathematical pinnacle of The Nine Chapters. In this chapter, systems of simultaneous linear equations were arranged as rectangular matrices of counting rods on the board. The system was then solved using the "Method of Repeated Subtraction," which is mathematically identical to Gaussian elimination.

To facilitate matrix reduction when minuends were smaller than subtrahends, the chapter introduced the world's earliest operational definitions of positive and negative numbers. Negative numbers were represented by black counting rods and positive numbers by red rods. The text formulated the definitive arithmetic rules: "For addition, numbers of identical sign combine, numbers of opposite sign subtract; zero minus positive yields negative, zero minus negative yields positive."

The introduction of signed numbers and their arithmetic rules was a monumental conceptual leap. While Indian mathematicians discussed negative quantities in the seventh century, European mathematicians resisted accepting negative numbers until the seventeenth century, demonstrating the profound originality of Han algebraic abstraction.

Arranging coefficients into vertical matrix columns allowed mathematicians to perform Gaussian row operations centuries before European algebra formalized matrix theory, underscoring the sophisticated operational nature of counting-rod calculation.

The "Gougu" Chapter: Pythagorean Theorem and Inscribed Circle Geometry

The ninth chapter, "Right Triangles," codified ancient geometric knowledge regarding right-angled triangles. It stated the Pythagorean theorem: "The square of the base and the square of the altitude combined yield the square of the hypotenuse; extract the square root to find the hypotenuse."

Beyond basic triangular relations, the chapter established advanced survey triangulation techniques to determine the height and distance of inaccessible objects, such as trees atop mountains or islands across water. It also deduced exact geometric formulas for squares and circles inscribed within right triangles.

The chapter demonstrated the characteristic Chinese integration of geometry and algebra. By expressing spatial relations through overlapping rectangles, problems were formulated as quadratic equations, foreshadowing the geometric-algebraic synthesis of the Song-Yuan Tian Yuan Shu (method of the celestial unknown).

The triangulation algorithms laid the foundation for Liu Hui's Haidao Suanjing (Sea Island Mathematical Manual). By setting up sighting poles and recording cast shadows, surveyors mapped distant geographical features, providing cartographic accuracy for imperial cadastral surveys.

Liu Hui's Commentary: Exhaustion Method and Mathematical Rigor

While The Nine Chapters provided operational algorithms and numerical solutions, it omitted theoretical proofs. In 263 AD (fourth year of Jingyuan of the Cao Wei state), the great mathematician Liu Hui authored his comprehensive commentary, providing rigorous deductive proofs for every mathematical formula in the canon.

In annotating the area of the circle, Liu Hui rejected the archaic approximation of three, creating the famous "Cyclotomic Method" based on limits. Beginning with an inscribed regular hexagon, he doubled the sides iteratively to a 192-sided polygon, proving that as divisions approach infinity, the polygon merges with the circle, yielding the approximation 3.1416.

Liu Hui formulated the "Dissection Principle" for solid geometry, analyzing the volumetric ratios of polyhedral building blocks to establish integration limits. His commentary transformed The Nine Chapters from a practical handbook into a theoretical masterpiece of international stature.

Liu's scientific attitude demonstrated fearless intellectual independence, openly revising traditional values through rigorous measurement and providing the intellectual framework that enabled Zu Chongzhi to calculate pi to seven decimal places.

Head of the Ten Computational Canons and Worldwide Transmission

Under the Tang Dynasty, the text received supreme institutional status. In 656 AD, Emperor Gaozong commanded Court Astrologer Li Chunfeng to compile the Ten Computational Canons, placing The Nine Chapters at the head of the imperial curriculum. It became the compulsory textbook for candidates in the civil service examination's mathematics section, requiring three full years of study.

The classic radiated across East Asia through maritime and overland Silk Roads. In the eighth century, Japanese embassies brought the text to Nara, where it became a required manual for imperial court scholars. It similarly influenced Korean arithmetic academies under the Silla and Goryeo dynasties, becoming the shared mathematical foundation of the Sinographic sphere.

In 1084 (seventh year of Yuanfeng), the Northern Song Directorate of Education published the first woodblock-printed edition of the canon, making it the world's earliest printed mathematical treatise. Conserved across dynasties, its algorithms provided the quantitative bedrock for Chinese technological civilization.

The print edition preserved both Liu Hui's and Li Chunfeng's annotations, ensuring the survival of the text until modern times, where it continues to inspire modern computational science and history of mathematics.

Key Figures

Han Compilers and Statesmen

  • Zhang Cang: Western Han Chancellor and Marquis of Beiping; early Han statesman who recovered ancient mathematical texts and initiated the systematic editing of the canon.
  • Geng Shouchang: Grand Minister of Agriculture under Emperor Xuan; astronomer and logistics expert who expanded the text with commercial and taxation algorithms.

Ancient Commentators and Inheritors

  • Liu Hui: Cao Wei mathematician and theoretical founder of traditional Chinese mathematics; composed the definitive commentary establishing deductive proofs and calculating pi to 3.1416.
  • Li Chunfeng: Tang Court Astrologer and mathematician; edited the imperial edition of the Ten Computational Canons, establishing the text within civil examination curricula.
  • Zu Chongzhi: Southern Dynasties scientist who built upon Liu Hui's methods to compute pi to seven decimal places, authoring the lost Zhuishu.
  • Dai Zhen: Qing dynasty philologist and Siku Quanshu editor; recovered the lost text from imperial encyclopedias, preserving the classic for the modern world.

Results and Historical Impact

Culmination of the East Asian Algorithmic Tradition

The compilation and annotation of The Nine Chapters on the Mathematical Art established an autonomous, algorithm-driven mathematical paradigm distinct from Western axiomatic Euclidean geometry. Characterized by constructive procedures, iterative approximations, and tabular matrices, this system was designed for programmable calculation. Modern scientists recognize that its focus on numerical execution aligns organically with twentieth-century computer science, cementing its status as an enduring triumph of classical Asian civilization.

Quantitative Keystone of Imperial Governance

Throughout two millennia of Chinese imperial history, The Nine Chapters functioned as the technical manual for civil administration. From the construction of the Grand Canal and the surveying of the Great Wall to the implementation of equitable taxation registers and the calculation of lunar calendars, imperial bureaucrats relied on its algorithms. The canon sustained the logistical and fiscal administration of the centralized bureaucratic empire across dynasties.

Historical Evaluation

Modern Scholarly Consensus

Historians of science evaluate The Nine Chapters on the Mathematical Art alongside Euclid's Elements as one of the two foundational masterpieces of ancient world mathematics. Joseph Needham celebrated the text for developing negative arithmetic and linear matrix elimination over a millennium ahead of the West. Chinese academician Wu Wenjun observed that the constructive algorithmic nature of the classic constitutes a dynamic intellectual tradition that anticipated modern computational theory.

Historical Records and Contemporary Accounts

  • Liu Hui in Preface to the Annotated Nine Chapters states: "From childhood I studied the Nine Chapters and contemplated its meaning... When the Duke of Zhou established the rites, he instituted the Nine Numeracies, from which the Nine Chapters flowed. Though branches divide, they share a single trunk, each revealing a facet of principle."
  • Li Chunfeng in Memorial Presenting the Computational Canons notes: "The Nine Chapters is vast and complete! Exalting the methods of square roots and equitable transportation, delving into the mysteries of equations and right triangles, it is an imperial treasure revered across successive dynasties."
  • Sui Shu (Treatise on Classics and Books) records: "The Han possessed the art of the Nine Chapters, collated by Zhang Cang and Geng Shouchang; transmitted through generations, it is the fountainhead of mathematics."
  • Ji Yun in Annotated Catalogue of the Siku Quanshu appraisal: "The Nine Chapters on the Mathematical Art is the head of all computational classics. From field measurements to right triangles, its algorithms are rigorous and profound, the undisputed ancestor of Chinese mathematics."

Related Entries

  • Ten Computational Canons
  • Liu Hui
  • Exhaustion Method
  • Pythagorean Theorem
  • Zhang Cang
  • Geng Shouchang
  • Li Chunfeng
  • Counting Rods
  • Elements
  • Zu Chongzhi

Bibliography

  • Guo Shuchun, New Collation of The Nine Chapters on the Mathematical Art, Liaoning Education Press, 1990.
  • Qian Baocong, History of Chinese Mathematics, Science Press, 1964.
  • Du Shiran, Mathematics, History, and Society, Liaoning Education Press, 2003.
  • Joseph Needham, Science and Civilisation in China, Volume 3: Mathematics and the Sciences of the Heavens and the Earth, Science Press, 1975.
  • Wu Wenjun, ed., Compendium of the History of Chinese Mathematics, Beijing Normal University Press, 1998.
  • Dai Zhen, ed., Ten Computational Canons, Zhonghua Book Company, 1980.