The gougu theorem (勾股定理, gōugǔ dìnglǐ) is the Chinese name for the Pythagorean theorem. Gou and gu are the two legs of a right triangle and xian is the hypotenuse, so the rule reads: gou squared plus gu squared equals xian squared. It appears in the Zhoubi Suanjing and the Nine Chapters on the Mathematical Art, both compiled during the Han dynasty (206 BCE – 220 CE).
The Chinese tradition, independent of Greece as far as any evidence shows, has its own style: problems first, then procedures, then justifications by cutting and moving areas. For the famous "hypotenuse diagram" that proves the theorem, see the Chinese proof of the Pythagorean theorem.
Gou, gu and xian: the vocabulary
The names make most sense when you picture a gnomon, an upright post used to measure the sun's shadow.
- 勾 gōu (also written 句) — "hook"
- The shorter leg. In shadow measurement it is the shadow lying flat on the ground. In our notation it is a.
- 股 gǔ — "thigh"
- The longer leg, standing upright like a leg. The Zhoubi says plainly: "the gnomon is the gu; the true shadow is the gou." In our notation it is b.
- 弦 xián — "bowstring"
- The hypotenuse, stretched across like a string between the ends of a bow. This is the standard term in the Nine Chapters; the older Zhoubi passages say 徑隅 jìng yú ("the diagonal between the corners") or 邪 xié ("slant"). In our notation it is c.
The Zhoubi Suanjing: Shang Gao and the Duke of Zhou
The Zhoubi Suanjing (周髀算經), "The Mathematical Classic of the Zhou Gnomon", is a book of astronomy and the mathematics needed for it. Bi literally means "thighbone" but here refers to the gnomon, and the text links the two leg-words directly: the gnomon is the gu, the "thigh" of the right triangle. The title's Zhou can mean the Zhou dynasty or "circuit", so it has also been translated as "the gnomon and the circular paths of heaven".
The book opens with a conversation. The Duke of Zhou asks the official Shang Gao how the ancients could measure heaven, which cannot be climbed by steps, and the earth, which cannot be measured with a rule: where do numbers come from? Shang Gao answers that the art of number comes from the circle and the square, the square from the carpenter's square (矩, jǔ), and then gives the example that has made the passage famous:
故折矩,以為句廣三,股修四,徑隅五。
"So bend the carpenter's square: let the gou be 3 wide and the gu 4 long; then the diagonal from corner to corner is 5." (our translation)
The next few lines describe forming a square on the outside, halving it and arranging carpenter's squares around it, ending with the remark that two carpenter's squares together come to 25: "this is called accumulating carpenter's squares." They are terse, and scholars translate and interpret them differently. In the third century CE the commentator Zhao Shuang added a diagram and a general argument, the "hypotenuse diagram" explained on the Chinese proof page.
The general rule: Chen Zi measures the sun
Shang Gao's passage only gives the 3-4-5 case. The general rule appears later in the same book, in a dialogue in which a student, Rong Fang, learns from a teacher named Chen Zi how to work out the sun's distance from gnomon shadows:
若求邪至日者,以日下為句,日高為股,句股各自乘,并而開方除之,得邪至日。
"To find the slant distance to the sun, take [the distance to the point] beneath the sun as gou and the height of the sun as gu. Multiply gou and gu each by itself, add them, and extract the square root: this gives the slant distance to the sun." (our translation)
That is the theorem in words, c = √a2 + b2, stated as a procedure. Chen Zi's numbers are 60,000 li along the ground and 80,000 li up, giving 100,000 li:
√60,0002 + 80,0002 = √10,000,000,000 = 100,000NoteThe geometry is right but the astronomy is not. Chen Zi assumes a flat Earth and a shadow that changes by one cun (a tenth of a chi) for every thousand li traveled north or south. The real sun is about 150 million kilometers away. What survives is the method.
How old is the Zhoubi?
Tradition placed the dialogue in the lifetime of the Duke of Zhou, around 1000 BCE, and you will still see claims that China knew the theorem three thousand years ago. Modern historians do not accept that. The book as we have it is a Han-dynasty compilation; estimates for its present form range from about the first century BCE to the first century CE. Christopher Cullen, its English translator, argues that it is best understood as a product of Han astronomy. Some passages, possibly including the Shang Gao dialogue, may preserve older material, but the Duke of Zhou is a literary frame, not a witness. In China the theorem is sometimes also called 商高定理, the "Shang Gao theorem".
The Nine Chapters: the gougu rule
The Nine Chapters on the Mathematical Art (九章算術, Jiǔzhāng Suànshù) is the great problem book of early Chinese mathematics. It was assembled from earlier material over a long period; most historians place its final form between roughly 100 BCE and 100 CE. Its ninth and last chapter, Gougu, contains 24 problems on right triangles. The opening problems apply the rule directly; later ones combine it with algebra and similar triangles.
The rule is given as a procedure, almost word for word the same as Chen Zi's: multiply gou and gu each by itself, add, and extract the square root to get the xian. The chapter also gives the reverse procedures — subtract the square of one leg from the square of the hypotenuse to find the other leg — which is exactly how you find a missing side today.
Lengths are in zhang, chi and cun: 1 zhang = 10 chi and 1 chi = 10 cun. A Han-period chi was roughly 23 cm, but the arithmetic does not depend on that.
Classic gougu problems, solved
Each of these problems hides a right triangle in an everyday scene. The statements are paraphrased; the answers are the Nine Chapters' own, checked here in modern notation. For more practice of the same kind, see the Pythagorean theorem word problems.
The reed in the pond
A square pond is 1 zhang (10 chi) on each side. A reed grows at its center and sticks up 1 chi above the water. Pulled toward the middle of one bank, its tip just reaches the water's edge. How deep is the water, and how long is the reed?
From the center to the bank is half the side, 5 chi. Call the depth x; the reed is x + 1. When the reed leans over, it is the hypotenuse of a right triangle with legs x and 5:
(x + 1)2= x2 + 52x2 + 2x + 1= x2 + 252x= 24x= 12The water is 12 chi (1 zhang 2 chi) deep and the reed is 13 chi long — a 5-12-13 triangle.
The Nine Chapters solves this without algebra symbols. Its procedure: square half the pond's width, subtract the square of the height above water, and divide by twice that height. Here (25 − 1) ÷ 2 = 12. That recipe is exactly the line 2x = 24 above, written as a rule.
The broken bamboo
A bamboo 1 zhang (10 chi) tall is broken, and its top touches the ground 3 chi from the foot of the stem. How high is the break?
Let the break be x chi above the ground. The standing part is one leg, the 3 chi on the ground is the other, and the fallen part, 10 − x, is the hypotenuse:
x2 + 32= (10 − x)2x2 + 9= 100 − 20x + x220x= 91x= 91 over 20 = 4.55The break is 411 over 20 chi (4.55 chi) above the ground; the fallen part is 5.45 chi.
The vine around the tree
A tree trunk is 2 zhang (20 chi) tall and 3 chi around. A vine grows from its foot, winds 7 times around the trunk and ends exactly at the top. How long is the vine?
Unroll the bark into a flat rectangle. Its height is 20 and its width is 7 turns × 3 chi = 21. The vine becomes the diagonal:
√212 + 202 = √441 + 400 = √841 = 29The vine is 29 chi (2 zhang 9 chi) long; 20-21-29 is one of the Pythagorean triples.
Try two more
Both of these are also in chapter 9. Solve them before opening the answers.
A rope hangs from the top of a post with 3 chi lying on the ground. Pulled taut, it reaches the ground 8 chi from the post. How long is the rope?
Let the rope be L. The post is L − 3, and the taut rope is the hypotenuse of a triangle with legs L − 3 and 8:
L2= (L − 3)2 + 82L2= L2 − 6L + 9 + 646L= 73So L = 73 over 6 = 121 over 6 chi (about 12.17), which the text writes as 1 zhang 2 and 1/6 chi.
A door's height is 6 chi 8 cun more than its width, and its diagonal is exactly 1 zhang. Find the width and height.
Let the width be w chi, so the height is w + 6.8 and w2 + (w + 6.8)2 = 102. This simplifies to w2 + 6.8w − 26.88 = 0, whose positive root is w = 2.8.
The width is 2 chi 8 cun and the height 9 chi 6 cun. Check: 2.82 + 9.62 = 7.84 + 92.16 = 100.
Liu Hui and the out-in principle (263 CE)
Liu Hui (c. 220 – c. 280) lived in the kingdom of Wei during the Three Kingdoms period. His commentary on the Nine Chapters, traditionally dated to 263 CE, does what the original text does not: it explains why the procedures work.
For the gougu rule he uses what historians call the out-in complementary principle (出入相補, chūrù xiāngbǔ): cut a figure into pieces, move the pieces without overlapping, and the area stays the same. He colors the square on the gou red and the square on the gu blue-green, then moves pieces of them "out" and "in", each to a matching place, until together they fill the square on the xian. His original diagram is lost, so modern reconstructions of the exact cuts differ; one is animated on the Chinese proof page. The idea is the same one behind the rearrangement proof.
Liu Hui also put the theorem to work in two famous directions:
- Calculating π. Starting from a hexagon inscribed in a circle of radius 1, he used the gougu rule twice per step to find the side of a polygon with twice as many sides. For the 12-gon: half the hexagon's side is 1 over 2, the distance from the center to that side is √1 − 1 over 4 ≈ 0.8660, the gap to the circle is about 0.1340, and the new side is √0.52 + 0.13402 ≈ 0.5176. Repeating this up to 96 and 192 sides gives an area of about 3.1410, which justified the value π ≈ 3.14.
- Measuring the unreachable. His Sea Island Mathematical Manual (海島算經, Haidao Suanjing), nine problems on finding heights and distances from sightings with poles, was originally attached to his commentary on chapter 9. It relies on gougu reasoning and similar triangles, the same tools surveyors use today (see the theorem in navigation).
Independent discovery and the question of "first"
Was the gougu theorem discovered before Pythagoras? On the evidence, the surviving Chinese texts are later than him: they took their present form in the Han dynasty, four or more centuries after Pythagoras (c. 570–c. 495 BCE) and two or more after Euclid (c. 300 BCE). They are also later than the Old Babylonian tablets such as Plimpton 322 and probably later than the Indian Śulba Sūtras.
That does not make the Chinese work derivative. There is no sign of Greek influence: the vocabulary, the gnomon setting, the problem-and-procedure style and the dissection justifications are all distinctively Chinese. Frank Swetz and T. I. Kao examine this tradition in detail in Was Pythagoras Chinese? (1977) and treat it as an independent development. The honest answer to "who discovered it?" is that several cultures did — see the history of the Pythagorean theorem for the full timeline.
Frequently asked questions
What is the gougu theorem?
It is the Chinese name for the Pythagorean theorem: in a right triangle, the square of the gou (short leg) plus the square of the gu (long leg) equals the square of the xian (hypotenuse). The name 勾股定理 is still what Chinese students learn today.
What do gou, gu and xian mean?
Gou means "hook" and is the shorter leg; gu means "thigh" and is the longer, upright leg; xian means "bowstring" and is the hypotenuse. The names come from measuring the sun's shadow with an upright post, where the post is the gu and the shadow the gou.
Did the Chinese know the Pythagorean theorem before Pythagoras?
Not on the surviving evidence. The Zhoubi Suanjing and Nine Chapters were compiled in the Han dynasty, centuries after Pythagoras, even though tradition set the Zhoubi dialogue around 1000 BCE. The Chinese discovery was, however, independent of Greece.
Who was Liu Hui?
Liu Hui was a third-century mathematician from the kingdom of Wei whose commentary on the Nine Chapters (traditionally dated 263 CE) justified its rules. He explained the gougu theorem by cutting and moving areas, computed π as about 3.14 with polygons, and wrote the Sea Island Mathematical Manual on surveying.
Sources and further reading
- Christopher Cullen, Astronomy and Mathematics in Ancient China: The Zhou Bi Suan Jing. Cambridge University Press, 1996. Translation and study, including the dating debate.
- Shen Kangshen, John N. Crossley and Anthony W.-C. Lun, The Nine Chapters on the Mathematical Art: Companion and Commentary. Oxford University Press and Science Press, 1999. Full translation with Liu Hui's commentary.
- Karine Chemla and Guo Shuchun, Les neuf chapitres: le classique mathématique de la Chine ancienne et ses commentaires. Dunod, 2004.
- Frank J. Swetz and T. I. Kao, Was Pythagoras Chinese? An Examination of Right Triangle Theory in Ancient China. Pennsylvania State University Press, 1977.
- Jean-Claude Martzloff, A History of Chinese Mathematics. Springer, 1997.
- MacTutor History of Mathematics, Nine Chapters on the Mathematical Art and Liu Hui.
- The Chinese text of the Zhoubi Suanjing quoted above: Project Gutenberg edition.
Keep exploring
- ProofsThe Chinese Proof: Gougu and the Hypotenuse DiagramThe Chinese proof of the Pythagorean theorem: the xian tu hypotenuse diagram from the Zhoubi Suanjing, the 3-4-5 grid and Liu Hui's out-in principle, animated.
- HistoryHistory of the Pythagorean TheoremThe history of the Pythagorean theorem from Babylon (1800 BCE) to a 2023 proof: who discovered it, who proved it first, and why it bears Pythagoras' name.
- HistoryBaudhāyana and the Śulba Sūtras: the Pythagorean Theorem in Ancient IndiaThe Baudhayana theorem in the Sulba Sutras: the Sanskrit rule for a rectangle's diagonal, Vedic altar geometry, triples, the √2 rule 577/408 and who was first.
- PracticePythagorean Theorem Word Problems15 Pythagorean theorem word problems from real life (ladders, TVs, ramps, ships, kites, roofs) with a 4-step strategy, a sketch for each and full solutions.
- LearnHow to Find the Missing Side of a Right TriangleHow to find a missing leg of a right triangle with a = √(c² − b²): why you subtract, five worked examples, a mental-math shortcut and impossible inputs.
- HistoryThābit ibn Qurra's Generalization of the Pythagorean TheoremThabit ibn Qurra's theorem extends the Pythagorean theorem to every triangle: AB² + AC² = BC·(BB′ + CC′). Statement, animation, proof and 9th-century Baghdad.