{{Short description|Relation between sides of a right triangle}}
{{use dmy dates|date=September 2025}}
{{pp-move-indef|small=yes}}
{{pp-semi-indef}}
{{Infobox mathematical statement
| name = Pythagorean theorem
| image = Pythagorean.svg
| caption =
| type = [[Theorem]]
| field = [[Euclidean geometry]]
| statement = The sum of the areas of the two squares on the legs ({{mvar|a}} and {{mvar|b}}) equals the area of the square on the hypotenuse ({{mvar|c}}).
| symbolic statement = {{math|1=''a''{{sup|2}} + ''b''{{sup|2}} = ''c''{{sup|2}}}}
| generalizations = {{Plainlist|
* [[Law of cosines]]
* [[Solid geometry]]
* [[Non-Euclidean geometry]]
* [[Differential geometry]]
}}
| consequences = {{Plainlist|
* [[Pythagorean triple]]
* [[#Inverse Pythagorean theorem|Reciprocal Pythagorean theorem]]
* [[Complex number]]
* [[Euclidean distance]]
* [[Pythagorean trigonometric identity]]
}}
}}
{{General geometry |concepts}}
In [[mathematics]], the '''Pythagorean theorem''' or '''Pythagoras's theorem''' is a fundamental relation in [[Euclidean geometry]] between the three sides of a [[right triangle]]. It states that the area of the [[square]] whose side is the [[hypotenuse]] (the side opposite the [[right angle]]) is equal to the sum of the areas of the squares on the other two sides.{{sfn|Saikia|2013}}
The [[theorem]] can be written as an [[equation]] relating the lengths of the sides {{mvar|a}}, {{mvar|b}} and the hypotenuse {{mvar|c}}, sometimes called the '''Pythagorean equation''':{{harvp|Sally|Sally|2007|p= [https://books.google.com/books?id=nHxBw-WlECUC&pg=PA63 63]|loc= Chapter 3: Pythagorean triples.}}
The theorem is named for the [[Ancient Greece|Greek]] philosopher [[Pythagoras]], born around 570 BC. The theorem has been [[Mathematical proof|proved]] numerous times by many different methods – possibly the most for any mathematical theorem. The proofs are diverse, including both [[Geometry|geometric]] proofs and [[Algebra|algebraic]] proofs, with some dating back thousands of years.
When [[Euclidean space]] is represented by a [[Cartesian coordinate system]] in [[analytic geometry]], [[Euclidean distance]] satisfies the Pythagorean relation: the squared distance between two points equals the sum of squares of the difference in each coordinate between the points.
The theorem can be [[#Generalizations|generalized]] in various ways: to [[higher-dimensional space]]s, to [[non-Euclidean geometry|spaces that are not Euclidean]], to objects that are not right triangles, and to objects that are not triangles at all but [[N-dimensional|{{mvar|n}}-dimensional]] solids.
==History==
[[File:Plimpton 322.jpg|thumb|The [[Plimpton 322|Plimpton 322 tablet]] records [[Pythagorean triple|Pythagorean triples]] from [[Babylonia|Babylonian]] times.{{harvnb|Neugebauer|1969|p=36}}.]]
Forms of the Pythagorean theorem have appeared in many ancient cultures, and the date of first discovery is uncertain, as is the date of the first proof. The history of the development of the theorem involves multiple aspects, including calculations regarding specific right triangles, knowledge of Pythagorean triples, understanding the relationship among the sides of a right triangle, and proofs of the theorem within some [[deductive system]].
Written {{c.}} 1800{{nbsp}}BC, the [[Ancient Egypt|Egyptian]] [[Middle Kingdom of Egypt|Middle Kingdom]] ''[[Berlin Papyrus 6619]]'' includes a problem involving two squares whose areas sum to a third square, whose solution is the Pythagorean triple 6:8:10, but the problem does not mention a triangle.{{cite book|first=Richard J.|last=Gillings|title=Mathematics in the Time of the Pharaohs|publisher=Dover|location=New York|year=1982|page=161}} According to [[Plutarch]], writing many centuries later, the ancient Egyptians did know about the 3:4:5 right triangle, identifying its sides with [[Osiris]], [[Isis]], and [[Horus]] respectively.{{cite book |author=[[Plutarch]] |url=https://archive.org/details/plutarch-isis-osiris-loeb/page/135 |title=Moralia V: Isis and Osiris |publisher=Harvard University Press |year=1936 |series=Loeb Classical Library |volume=306 |page=135 |translator-last=Babbitt |translator-first=Frank Cole}}
Historians of [[Mesopotamia|Mesopotamian]] mathematics have concluded that the Pythagorean rule was in widespread use during the [[Old Babylonian period]] (20th to 16th centuries BC), over a thousand years before [[Pythagoras]] was born.{{harvnb|Neugebauer|1969}}: p. 36 "In other words it was known during the whole duration of Babylonian mathematics that the sum of the squares on the lengths of the sides of a right triangle equals the square of the length of the hypotenuse."{{cite journal |author=Friberg, Jöran |year=1981 |title=Methods and traditions of Babylonian mathematics: Plimpton 322, Pythagorean triples, and the Babylonian triangle parameter equations |url=https://www.researchgate.net/publication/222892801 |journal=Historia Mathematica |volume=8 |pages=277–318 |doi=10.1016/0315-0860(81)90069-0 |doi-access=free}}: p. 306 "Although Plimpton 322 is a unique text of its kind, there are several other known texts testifying that the Pythagorean theorem was well known to the mathematicians of the Old Babylonian period."{{cite conference |last=Høyrup |first=Jens |author-link=Jens Høyrup |year=1999 |editor-last=Renger |editor-first=Johannes |title=Babylon: Focus mesopotamischer Geschichte, Wiege früher Gelehrsamkeit, Mythos in der Moderne. 2. Internationales Colloquium der Deutschen Orient-Gesellschaft 24.–26. März 1998 in Berlin |url=http://akira.ruc.dk/~jensh/Publications/Pythrule.pdf |publisher=Berlin: Deutsche Orient-Gesellschaft / Saarbrücken: SDV Saarbrücker Druckerei und Verlag |pages=393–407 |contribution=Pythagorean 'Rule' and 'Theorem' – Mirror of the Relation Between Babylonian and Greek Mathematics}}, p. 406, "''To judge from this evidence alone'' it is therefore likely that the Pythagorean rule was discovered within the lay surveyors' environment, possibly as a spin-off from the problem treated in Db2-146, somewhere between 2300 and 1825 BC." ([[Db2-146|Db2-146]] is an Old Babylonian clay tablet from [[Eshnunna]] concerning the computation of the sides of a rectangle given its area and diagonal.){{harvnb|Robson|2008|p=109}}: "Many Old Babylonian mathematical practitioners ... knew that the square on the diagonal of a right triangle had the same area as the sum of the squares on the length and width: that relationship is used in the worked solutions to word problems on cut-and-paste 'algebra' on seven different tablets, from Ešnuna, Sippar, Susa, and an unknown location in southern Babylonia." The Mesopotamian tablet ''[[Plimpton 322]]'', written near [[Larsa]] also {{c.}} 1800{{nbsp}}BC, contains entries that can be interpreted as the sides and diagonals of 15 different Pythagorean triples.{{sfn|Robson|2001}} Another tablet from a similar time, [[YBC 7289]], calculates the diagonal of a square or, equivalently, of an isosceles right triangle.{{cite journal |last=Mackinnon |first=Nick |date=March 1992 |title=Homage to Babylonia |journal=The Mathematical Gazette |volume=76 |issue=475 |pages=158–178 |doi=10.2307/3620389 |jstor=3620389}}
In [[India]], the ''[[Baudhayana]] [[Shulba Sutras|Shulba Sutra]]'', the dates of which are given variously as between the 8th and 5th century BC,{{cite book |author=Kim Plofker |author-link=Kim Plofker |title=Mathematics in India |title-link=Mathematics in India (book) |publisher=Princeton University Press |year=2009 |isbn=978-0-691-12067-6 |pages=[https://books.google.com/books?id=DHvThPNp9yMC&pg=PA17 17–18]}} contains a list of Pythagorean triples and a statement of the Pythagorean theorem, both in the special case of the [[Isosceles triangle|isosceles]] [[Isosceles right triangle|right triangle]] and in the general case, as does the ''[[Apastamba]] Shulba Sutra'' ({{circa|600 BC}}).{{efn|{{harvp|van der Waerden|1983|p=[https://archive.org/details/geometryalgebrai0000waer/page/26/ 26]}} believed that this material "was certainly based on earlier traditions". [[Carl Benjamin Boyer|Carl Boyer]] states that the Pythagorean theorem in the ''[[Shulba Sutras|Śulba-sũtram]]'' may have been influenced by ancient Mesopotamian math, but there is no conclusive evidence in favor or opposition of this possibility.{{harvp|Boyer|Merzbach|2011|p=187}}: "[In Sulba-sutras,] we find rules for the construction of right angles by means of triples of cords the lengths of which form Pythagorean triages, such as 3, 4, and 5, or 5, 12, and 13, or 8, 15, and 17, or 12, 35, and 37. Although Mesopotamian influence in the ''Sulvasũtras'' is not unlikely, we know of no conclusive evidence for or against this. Aspastamba knew that the square on the diagonal of a rectangle is equal to the sum of the squares on the two adjacent sides. Less easily explained is another rule given by Apastamba – one that strongly resembles some of the geometric algebra in Book II of Euclid's ''Elements''. (...)"}}
[[File:Chinese pythagoras.jpg|thumb|250px|Geometric proof of the Pythagorean theorem from the ''[[Zhoubi Suanjing]]'']]
[[Byzantine Empire|Byzantine]] [[Neoplatonism|Neoplatonic]] philosopher and mathematician [[Proclus]], writing in the fifth century AD, states two arithmetic rules, "one of them attributed to [[Plato]], the other to Pythagoras",{{cite book |author=Proclus |title=A Commentary of the First Book of Euclid's ''Elements'' |publisher=Princeton University Press |year=1970 |at=428.6 |translator-last=Morrow |translator-first=Glenn R.}} for generating special Pythagorean triples. The rule attributed to Pythagoras ({{circa|570|495 BC}}) starts from an [[Parity (mathematics)|odd number]] and produces a triple with leg and hypotenuse differing by one unit; the rule attributed to Plato (428/427 or 424/423 – 348/347 BC) starts from an even number and produces a triple with leg and hypotenuse differing by two units. According to [[T. L. Heath|Thomas L. Heath]] (1861–1940), no specific attribution of the theorem to Pythagoras exists in the surviving Greek literature from the five centuries after Pythagoras lived.{{Cite web |date=March 25, 1908 |title=Introduction and books 1,2 |url=https://books.google.com/books?id=UhgPAAAAIAAJ&pg=PA351 |publisher=The University Press |via=Google Books}} However, when authors such as [[Plutarch]] and [[Cicero]] attributed the theorem to Pythagoras, they did so in a way which suggests that the attribution was widely known and undoubted.{{harv|Heath|1921|loc=Vol I, p. 144}}: "Though this is the proposition universally associated by tradition with the name of Pythagoras, no really trustworthy evidence exists that it was actually discovered by him. The comparatively late writers who attribute it to him add the story that he sacrificed an ox to celebrate his discovery."
An extensive discussion of the historical evidence is provided in {{Harv|Euclid|1956|p=[https://books.google.com/books?id=UhgPAAAAIAAJ&pg=PA351 351]}} [[Classics|Classicist]] [[Kurt von Fritz]] wrote, "Whether this formula is rightly attributed to Pythagoras personally ... one can safely assume that it belongs to the very oldest period of [[Pythagoreanism|Pythagorean mathematics]]."{{sfnp|Fritz|1945|p=252}} Around 300 BC, in [[Euclid's Elements|Euclid's ''Elements'']], the oldest extant [[Mathematics|axiomatic proof]] of the theorem is presented,{{cite book |last=Aaboe |first=Asger |url=https://books.google.com/books?id=5wGzF0wPFYgC&pg=PA51 |title=Episodes From the Early History of Mathematics |date=1997 |publisher=Mathematical Association of America |isbn=0-88385-613-1 |page=51 |quote=... it is not until Euclid that we find a logical sequence of general theorems with proper proofs.}} along with [[Euclid's formula]] for generating all primitive [[Pythagorean triple|Pythagorean triples]].
With contents known much earlier, but in surviving texts dating from roughly the 1st century BC, the [[China|Chinese]] text ''[[Zhoubi Suanjing]]'' (周髀算经), (''The Arithmetical Classic of the [[Gnomon (figure)|Gnomon]] and the Circular Paths of Heaven'') gives a reasoning for the Pythagorean theorem for the (3, 4, 5) triangle — in China it is called the "'''Gougu theorem'''" (勾股定理).{{cite book |last=Crease |first=Robert P. |url=https://archive.org/details/greatequationsbr0000crea/page/25 |title=The Great Equations: Breakthroughs in Science From Pythagoras to Heisenberg |date=2008 |publisher=W W Norton & Co. |isbn=978-0-393-06204-5 |page=[https://archive.org/details/greatequationsbr0000crea/page/25 25]}}A rather extensive discussion of the origins of the various texts in the Zhou Bi is provided by {{cite book |last=Cullen |first=Christopher |title=Astronomy and Mathematics in Ancient China: The 'Zhou Bi Suan Jing' |date=2007 |publisher=Cambridge University Press |isbn=978-0-521-03537-8 |pages=139 ''ff''}} During the [[Han Dynasty]] (202 BC to 220 AD), Pythagorean triples appear in ''[[The Nine Chapters on the Mathematical Art]]'',This work is a compilation of 246 problems, some of which survived the book burning of 213 BC, and was put in final form before 100 AD. It was extensively commented upon by Liu Hui in 263 AD. {{cite book |last=Straffin |first=Philip D. Jr. |title=Sherlock Holmes in Babylon: and Other Tales of Mathematical History |date=2004 |publisher=Mathematical Association of America |isbn=0-88385-546-1 |editor1-last=Anderson |editor1-first=Marlow |pages=69 ''ff'' |chapter=Liu Hui and the First Golden Age of Chinese Mathematics |editor2-last=Katz |editor2-first=Victor J. |editor2-link=Victor J. Katz |editor3-last=Wilson |editor3-first=Robin J. |editor3-link=Robin Wilson (mathematician) |chapter-url=https://books.google.com/books?id=BKRE5AjRM3AC&pg=PA69}} See particularly §3: ''Nine chapters on the mathematical art'', pp. 71 ''ff''. together with a mention of right triangles.{{cite book |last1=Shen |first1=Kangshen |url=https://books.google.com/books?id=eiTJHRGTG6YC&pg=PA488 |title=The Nine Chapters on the Mathematical Art: Companion and Commentary |last2=Crossley |first2=John N. |last3=Lun |first3=Anthony Wah-Cheung |date=1999 |publisher=Oxford University Press |isbn=0-19-853936-3 |page=488}} Some believe the theorem arose first in [[China]] in the 11th century BC,In particular, Li Jimin; see {{cite book |url=https://books.google.com/books?id=UJlFAAAAYAAJ&q=%22Shang+Gao+Theorem%22 |title=Centaurus, Volume 39 |publisher=Munksgaard |year=1997 |location=Copenhagen |pages=193, 205}} where it is alternatively known as the "'''Shang Gao theorem'''" (商高定理),{{cite book |last=Chen |first=Cheng-Yih |title=Early Chinese Work in Natural Science: a Re-examination of the Physics of Motion, Acoustics, Astronomy and Scientific Thoughts |date=1996 |publisher=Hong Kong University Press |isbn=962-209-385-X |page=142 |chapter=§3.3.4 Chén Zǐ's formula and the Chóng-Chã method; Figure 40 |chapter-url=https://books.google.com/books?id=2Wxj0SW9hBgC&pg=PA139}} named after the [[Duke of Zhou]]'s astronomer and mathematician, whose reasoning composed most of what was in the ''[[Zhoubi Suanjing]]''.{{cite book |last=Wu |first=Wen-tsün |title=Selected works of Wen-tsün Wu |date=2008 |publisher=World Scientific |isbn=978-981-279-107-8 |page=158 |chapter=The Gougu Theorem |chapter-url=https://books.google.com/books?id=xV4lECaKDzwC&pg=PA158}}
==Proofs using constructed squares==
[[File:Animated gif version of SVG of rearrangement proof of Pythagorean theorem.gif|thumb|400px|Rearrangement proof of the Pythagorean theorem.
(The area of the white space remains constant throughout the translation rearrangement of the triangles. At all moments in time, the area is always {{math|''c''{{sup|2}}}}. And likewise, at all moments in time, the area is always {{math|''a''{{sup|2}} + ''b''{{sup|2}}}}.)]]
=== Rearrangement proofs ===
In one rearrangement proof, two squares are used whose sides have a measure of and which contain four right triangles whose sides are {{mvar|a}}, {{mvar|b}} and {{mvar|c}}, with the hypotenuse being {{mvar|c}}. In the square on the right side, the triangles are placed such that the corners of the square correspond to the corners of the right angle in the triangles, forming a square in the center whose sides are length {{mvar|c}}. Each outer square has an area of {{math|(''a'' + ''b''){{sup|2}}}} as well as {{math|2''ab'' + ''c''{{sup|2}}}}, with {{math|2''ab''}} representing the total area of the four triangles. Within the big square on the left side, the four triangles are moved to form two similar rectangles with sides of length {{mvar|a}} and {{mvar|b}}. These rectangles in their new position have now delineated two new squares, one having side length {{mvar|a}} is formed in the bottom-left corner, and another square of side length {{mvar|b}} formed in the top-right corner. In this new position, this left side now has a square of area {{math|(''a'' + ''b''){{sup|2}}}} as well as {{math|2''ab'' + ''a''{{sup|2}} + ''b''{{sup|2}}}}[[Q.E.D.|.]] Since both squares have the area of {{math|(''a'' + ''b''){{sup|2}}}} it follows that the other measure of the square area also equal each other such that {{math|1=2''ab'' + ''c''{{sup|2}} =}} {{math|2''ab'' + ''a''{{sup|2}} + ''b''{{sup|2}}}}. With the area of the four triangles removed from both side of the equation what remains is {{math|1=''a''{{sup|2}} + ''b''{{sup|2}} = ''c''{{sup|2}}}}.{{cite book |last= Benson |first= Donald |date= 1999 |title= The Moment of Proof: Mathematical Epiphanies |pages= 172–173 |publisher= Oxford University Press |isbn= 978-0-19-513919-8 |url= https://books.google.com/books?id=8_vbuzxrpfIC&pg=PA172 }}
In another proof rectangles in the second box can also be placed such that both have one corner that correspond to consecutive corners of the square. In this way they also form two boxes, this time in consecutive corners, with areas {{math|''a''{{sup|2}}}} and {{math|''b''{{sup|2}}}} which will again lead to a second square of with the area {{math|2''ab'' + ''a''{{sup|2}} + ''b''{{sup|2}}}}.
English mathematician [[Thomas Heath (classicist)|Sir Thomas Heath]] gives this proof in his commentary on Proposition I.47 in [[Euclid]]'s ''[[Euclid's Elements|Elements]]'', and mentions the proposals of German mathematicians [[Carl Anton Bretschneider]] and [[Hermann Hankel]] that Pythagoras may have known this proof. Heath himself favors a different proposal for a Pythagorean proof, but acknowledges from the outset of his discussion "that the Greek literature which we possess belonging to the first five centuries after Pythagoras contains no statement specifying this or any other particular great geometric discovery to him."{{sfn|Euclid|1956|pp=351–352}} Recent scholarship has cast increasing doubt on any sort of role for Pythagoras as a creator of mathematics, although debate about this continues.{{cite encyclopedia |last= Huffman |first= Carl |date= 23 February 2005 |title= Pythagoras |encyclopedia= The Stanford Encyclopedia of Philosophy (Winter 2018 Edition) |edition= Winter 2018 |url= https://plato.stanford.edu/archives/win2018/entries/pythagoras/ |editor-last= Zalta |editor-first= Edward N. |editor-link= Edward N. Zalta |quote= It should now be clear that decisions about sources are crucial in addressing the question of whether Pythagoras was a mathematician and scientist. The view of Pythagoras's cosmos sketched in the first five paragraphs of this section, according to which he was neither a mathematician nor a scientist, remains the consensus.}}
=== Algebraic proofs ===
[[File:Pythagoras algebraic2.svg|thumb|upright|Diagram of the two algebraic proofs]]
The theorem can be proved algebraically using four copies of the same triangle arranged symmetrically around a square with side {{mvar|c}}, as shown in the lower part of the diagram.{{harvp|Bogomolny|2016|loc= [https://www.cut-the-knot.org/pythagoras/index.shtml#4 Proof #4]}}. This results in a larger square, with side {{math|''a'' + ''b''}} and area {{math|(''a'' + ''b'')2}}. The four triangles and the square side {{mvar|c}} must have the same area as the larger square,
giving
A similar proof uses four copies of a right triangle with sides {{mvar|a}}, {{mvar|b}} and {{mvar|c}}, arranged inside a square with side {{mvar|c}} as in the top half of the diagram.{{harvp|Bogomolny|2016|loc= [https://www.cut-the-knot.org/pythagoras/index.shtml#3 Proof #3]}}. The triangles are similar with area {{math|{{sfrac|1|2}}''ab''}}, while the small square has side {{math|''b'' − ''a''}} and area {{math|(''b'' − ''a'')2}}. The area of the large square is therefore
But this is a square with side {{mvar|c}} and area {{math|''c''2}}, so
==Other proofs of the theorem==
This theorem may have more known proofs than any other (the [[Law (principle)#Miscellaneous|law]] of [[quadratic reciprocity]] being another contender for that distinction); the book ''The Pythagorean Proposition'' contains 370 proofs.{{sfn|Loomis|1940}}
===Proof using similar triangles===
{{hatnote|1= In this section, and as usual in geometry, a "word" of two capital letters, such as {{mvar|AB}} denotes the length of the [[line segment]] defined by the points labeled with the letters, and not a multiplication. So, {{math|{{mvar|AB}}{{sup|2}}}} denotes the square of the length {{mvar|AB}} and not the product {{math|{{mvar|A}} × {{mvar|B}}{{sup|2}}}}.}}
[[File:Pythagoras similar triangles simplified.svg|thumb|Proof using similar triangles]]
This proof is based on the [[proportionality (mathematics)|proportionality]] of the sides of three [[Similarity (geometry)|similar]] triangles, that is, upon the fact that the [[ratio]] of any two corresponding sides of similar triangles is the same regardless of the size of the triangles.
Let {{mvar|ABC}} represent a right triangle, with the [[right angle]] located at {{mvar|C}}, as shown on the figure. Draw the [[altitude (triangle)|altitude]] from point {{mvar|C}}, and call {{mvar|H}} its intersection with the side {{mvar|AB}}. Point {{mvar|H}} divides the length of the hypotenuse {{mvar|c}} into parts {{mvar|d}} and {{mvar|e}}. The new triangle, {{mvar|ACH}}, is [[Similarity (geometry)|similar]] to triangle {{mvar|ABC}}, because they both have a right angle (by definition of the altitude), and they share the angle at {{mvar|A}}, meaning that the third angle will be the same in both triangles as well, marked as {{mvar|θ}} in the figure. By a similar reasoning, the triangle {{mvar|CBH}} is also similar to {{mvar|ABC}}. The proof of similarity of the triangles requires the [[triangle postulate]]: The sum of the angles in a triangle is two right angles, and is equivalent to the [[parallel postulate]]. Similarity of the triangles leads to the equality of ratios of corresponding sides:
The first result equates the [[cosine]]s of the angles {{mvar|θ}}, whereas the second result equates their [[sine]]s.
These ratios can be written as
Summing these two equalities results in
which, after simplification, demonstrates the Pythagorean theorem:
The role of this proof in history is the subject of much speculation. The underlying question is why Euclid did not use this proof, but invented another. One conjecture is that the proof by similar triangles involved a theory of proportions, a topic not discussed until later in the ''Elements'', and that the theory of proportions needed further development at that time.{{sfnp|Maor|2007|p= [https://books.google.com/books?id=Z5VoBGy3AoAC&dq=%22why+did+Euclid+choose+this+particular+proof%22&pg=PA39 39]}}
===Proof by dissection and scaling===
[[File:Einstein-trigonometric-proof.svg|thumb|Right triangle on the hypotenuse dissected into two [[similarity (geometry)|similar]] right triangles on the legs.]]
In one proof by dissection, sometimes attributed to [[Albert Einstein]],{{Cite book |last= Schroeder |first= Manfred Robert |date= 2012 |title= Fractals, Chaos, Power Laws: Minutes from an Infinite Paradise |publisher= Courier Corporation |pages= 3–4 |isbn= 978-0486134789 |quote=I have the story from Schneior Lifson of the Weizmann Institute in Tel Aviv, who has it from Einstein's assistant Ernst Strauss, to whom it was told by old Albert himself.}} the pieces do not need to be moved. The dissection consists of dropping a perpendicular from the vertex of the right angle of the triangle to the hypotenuse, thus splitting the whole triangle into two parts. Those two parts have the same shape as the original right triangle, and have the legs of the original triangle as their hypotenuses, and the sum of their areas is that of the original triangle. Because the ratio of the area of a right triangle to the square of its hypotenuse is the same for similar triangles, the relationship between the areas of the three triangles holds for the squares of the sides of the large triangle as well. In other words, because the area of the original triangle is the sum of the areas of the two smaller triangles, and because [[Similarity (geometry)#Area ratio and volume ratio|scaling a triangle changes the area by the square of the scaling factor]], the square of the original hypotenuse is the sum of the squares of the shorter hypotenuses.{{cite book|first=A. B. |last=Migdal |author-link=Arkady Migdal |year=1977 |title=Qualitative Methods in Quantum Theory |translator-first=Anthony J.|translator-last=Legett |translator-link=Anthony Leggett |publisher=W. A. Benjamin |isbn=0-8053-7064-1 |orig-year=1975 |edition=English translation |page=2}}{{cite book|first=N. David |last=Mermin |author-link=N. David Mermin |title=Why Quark Rhymes With Pork |pages=287–288 |publisher=Cambridge University Press |year=2016 |isbn=978-1-107-02430-4 }}
===Euclid's proof===
[[File:Illustration to Euclid's proof of the Pythagorean theorem.svg|thumb|Proof in Euclid's ''Elements'']]
In outline, here is how the proof in [[Euclid]]'s ''[[Euclid's Elements|Elements]]'' (Proposition 47 of Book I) proceeds. The large square is divided into a left and right rectangle. A triangle is constructed that has half the area of the left rectangle. Then another triangle is constructed that has half the area of the square on the left-most side. These two triangles are shown to be [[Congruence (geometry)|congruent]], proving this square has the same area as the left rectangle. This argument is followed by a similar version for the right rectangle and the remaining square. Putting the two rectangles together to reform the square on the hypotenuse, its area is the same as the sum of the area of the other two squares. The details follow.
Let {{mvar|A}}, {{mvar|B}}, {{mvar|C}} be the [[Vertex (geometry)|vertices]] of a right triangle, with a right angle at {{mvar|A}}. Drop a perpendicular from {{mvar|A}} to the side opposite the hypotenuse in the square on the hypotenuse. That line divides the square on the hypotenuse into two rectangles, each having the same area as one of the two squares on the legs.
For the formal proof, we require four elementary [[lemma (mathematics)|lemmata]]:
# If two triangles have two sides of the one equal to two sides of the other, each to each, and the angles included by those sides equal, then the triangles are congruent ([[side angle side|side-angle-side]]).
# The area of a triangle is half the area of any parallelogram on the same base and having the same altitude.
# The area of a rectangle is equal to the product of two adjacent sides.
# The area of a square is equal to the product of two of its sides (follows from 3).
Next, each top square is related to a triangle congruent with another triangle related in turn to one of two rectangles making up the lower square.See for example [http://www.slu.edu/classes/maymk/GeoGebra/Pythagoras.html Pythagorean theorem by shear mapping] {{Webarchive|url=https://web.archive.org/web/20161014165156/http://www.slu.edu/classes/maymk/GeoGebra/Pythagoras.html |date=2016-10-14 }}, Saint Louis University website Java applet
{{Clear}}
[[File:Illustration to Euclid's proof of the Pythagorean theorem2.svg|thumb|Illustration including the new lines]]
[[File:Illustration to Euclid's proof of the Pythagorean theorem3.svg|thumb|Showing the two congruent triangles of half the area of rectangle {{mvar|BDLK}} and square {{mvar|BAGF}}]]
The proof is as follows:
#Let {{mvar|ACB}} be a right-angled triangle with right angle {{mvar|CAB}}.
#On each of the sides {{mvar|BC}}, {{mvar|AB}}, and {{math|CA}}, squares are drawn, {{mvar|CBDE}}, {{mvar|BAGF}}, and {{mvar|ACIH}}, in that order. The construction of squares requires the immediately preceding theorems in Euclid, and depends upon the parallel postulate.{{cite book |last= Gullberg |first= Jan |date= 1997 |title= Mathematics: from the birth of numbers |page= [https://archive.org/details/mathematicsfromb1997gull/page/435 435] |url= https://archive.org/details/mathematicsfromb1997gull |url-access= registration |isbn= 0-393-04002-X |publisher= W. W. Norton & Company}}
#From {{mvar|A}}, draw a line parallel to {{mvar|BD}} and {{mvar|CE}}. It will perpendicularly intersect {{mvar|BC}} and {{mvar|DE}} at {{mvar|K}} and {{mvar|L}}, respectively.
#Join {{mvar|CF}} and {{mvar|AD}}, to form the triangles {{mvar|BCF}} and {{mvar|BDA}}.
#Angles {{mvar|CAB}} and {{mvar|BAG}} are both right angles; therefore {{mvar|C}}, {{mvar|A}}, and {{mvar|G}} are [[Line (geometry)#Collinear points|collinear]].
#Angles {{mvar|CBD}} and {{mvar|FBA}} are both right angles; therefore angle {{mvar|ABD}} equals angle {{mvar|FBC}}, since both are the sum of a right angle and angle {{mvar|ABC}}.
#Since {{mvar|AB}} is equal to {{mvar|FB}}, {{mvar|BD}} is equal to {{mvar|BC}} and angle {{mvar|ABD}} equals angle {{mvar|FBC}}, triangle {{mvar|ABD}} must be congruent to triangle {{mvar|FBC}}.
#Since {{math|''A''-''K''-''L''}} is a straight line, parallel to {{mvar|BD}}, then rectangle {{mvar|BDLK}} has twice the area of triangle {{mvar|ABD}} because they share the base {{mvar|BD}} and have the same altitude {{mvar|BK}}, i.e., a line normal to their common base, connecting the parallel lines {{mvar|BD}} and {{mvar|AL}}. (lemma 2)
#Since {{mvar|C}} is collinear with {{mvar|A}} and {{mvar|G}}, and this line is parallel to {{mvar|FB}}, then square {{mvar|BAGF}} must be twice in area to triangle {{mvar|FBC}}.
#Therefore, rectangle {{mvar|BDLK}} must have the same area as square {{math|1=''BAGF'' = ''AB''{{sup|2}}}}.
#By applying steps 3 to 10 to the other side of the figure, it can be similarly shown that rectangle {{math|CKLE}} must have the same area as square {{math|1=''ACIH'' = ''AC''{{sup|2}}}}.
#Adding these two results, {{math|1=''AB''{{sup|2}} + ''AC''{{sup|2}} =}} {{math|1=''BD'' × ''BK'' + ''KL'' × ''KC''}}
#Since {{math|1=''BD'' = ''KL''}}, {{math|1=''BD'' × ''BK'' + ''KL'' × ''KC'' =}} {{math|1=''BD''(''BK'' + ''KC'') =}} {{math|1=''BD'' × ''BC''}}
#Therefore, {{math|1=''AB''{{sup|2}} + ''AC''{{sup|2}} = ''BC''{{sup|2}}}}, since {{math|''CBDE''}} is a square {{math|1=(''BD'' × ''BC'' = ''BC''{{sup|2}})}}.
This proof, which appears in Euclid's ''Elements'' as that of Proposition 47 in Book 1, demonstrates that the area of the square on the hypotenuse is the sum of the areas of the other two squares.{{cite web |last= Heiberg |first= J. L. |title= Euclid's Elements of Geometry |url= https://farside.ph.utexas.edu/Books/Euclid/Elements.pdf |pages= 46–47}}{{cite web |title=Euclid's Elements, Book I, Proposition 47 |url=http://aleph0.clarku.edu/~djoyce/java/elements/bookI/propI47.html}} See also a [http://aleph0.clarku.edu/~djoyce/java/elements/elements.html web page version using Java applets] by [[David E. Joyce (mathematician)|David E. Joyce]], Clark University.
This is quite distinct from the proof by similarity of triangles, which is conjectured to be the proof that Pythagoras used.{{harvp|Hawking|2005|p=12}}. This proof first appeared after a computer program was set to check Euclidean proofs.{{efn|The proof by Pythagoras probably was not a general one, as the theory of proportions was developed only two centuries after Pythagoras; see {{Harvp |Maor|2007 |p= [https://books.google.com/books?id=Z5VoBGy3AoAC&pg=PA25 25]}}.}}
===Proofs by dissection and rearrangement===
Another by rearrangement is given by the middle animation. A large square is formed with area {{math|''c''2}}, from four identical right triangles with sides {{mvar|a}}, {{mvar|b}} and {{mvar|c}}, fitted around a small central square. Then two rectangles are formed with sides {{mvar|a}} and {{mvar|b}} by moving the triangles. Combining the smaller square with these rectangles produces two squares of areas {{math|''a''2}} and {{math|''b''2}}, which must have the same area as the initial large square.{{harvp|Bogomolny|2016|loc= [https://www.cut-the-knot.org/pythagoras/index.shtml#10 Proof #10]}}.
The third, rightmost image also gives a proof. The upper two squares are divided as shown by the blue and green shading, into pieces that when rearranged can be made to fit in the lower square on the hypotenuse – or conversely the large square can be divided as shown into pieces that fill the other two. This way of cutting one figure into pieces and rearranging them to get another figure is called [[dissection problem|dissection]]. This shows the area of the large square equals that of the two smaller ones.{{Harv|Loomis|1940|loc= Geometric proof 22 and Figure 123| page= 113}}
{|
| [[File:Pythag anim.gif|thumb|Animation showing proof by rearrangement of four identical right triangles]]
| [[File:Pythagoras-2a.gif|thumb|Animation showing another proof by rearrangement]]
| [[File:Pythagorean theorem rearrangement.svg|thumb|Proof using an elaborate rearrangement]]
|}
===Proof by area-preserving shearing===
[[File:Visual proof of the Pythagorean theorem by area-preserving shearing.gif|thumb|Visual proof of the Pythagorean theorem by area-preserving shearing]]
As shown in the accompanying animation, area-preserving [[Shear_mapping|shear mappings]] and translations can transform the squares on the sides adjacent to the right-angle onto the square on the hypotenuse, together covering it exactly.{{cite book |last1=Polster |first1=Burkard |title=Q.E.D.: Beauty in Mathematical Proof |date=2004 |publisher=Walker Publishing Company |page=49}} Each shear leaves the base and height unchanged, thus leaving the area unchanged too. The translations also leave the area unchanged, as they do not alter the shapes at all. Each square is first sheared into a parallelogram, and then into a rectangle which can be translated onto one section of the square on the hypotenuse.
===Other algebraic proofs===
A related [[Garfield's proof of the Pythagorean theorem|proof by U.S. president James A. Garfield]] was published before he was elected president; while he was a [[U.S. representative]].Published in a weekly mathematics column: {{cite journal |last= Garfield |first= James A. |date= 1876 |title= Pons Asinorum |journal=The New England Journal of Education |volume= 3 |issue= 14 |page= 161 |url= http://www.maa.org/press/periodicals/convergence/mathematical-treasure-james-a-garfields-proof-of-the-pythagorean-theorem |postscript= ; }} as noted in {{cite book |last= Dunham |first= William |date= 1997 |title= The Mathematical Universe: An Alphabetical Journey Through the Great Proofs, Problems, and Personalities |publisher= Wiley |isbn= 0-471-17661-3 |page= 96 |url= https://books.google.com/books?id=3tG_FRQ9N1QC&q=New+England+Journal }}{{cite web |last= Lantz |first= David |date= 2008 |title= Garfield's proof of the Pythagorean Theorem |url= http://math.colgate.edu/faculty/dlantz/Pythpfs/Garfldpf.html |website= Colgate University Faculty Pages |access-date= 2018-01-14 |archive-url= https://web.archive.org/web/20130828104818/http://math.colgate.edu/faculty/dlantz/Pythpfs/Garfldpf.html |archive-date= 2013-08-28 |url-status= live}}{{sfnp|Maor|2007|pp=106–107}} Instead of a square it uses a [[trapezoid]], which can be constructed from the square in the second of the above proofs by bisecting along a diagonal of the inner square, to give the trapezoid as shown in the diagram. The [[trapezoid#Area|area of the trapezoid]] can be calculated to be half the area of the square, that is
The inner square is similarly halved, and there are only two triangles so the proof proceeds as above except for a factor of {{tmath|\tfrac{1}{{mset|2}}}}, which is removed by multiplying by two to give the result.
===Proof using differentials===
One can arrive at the Pythagorean theorem by studying how changes in a side produce a change in the hypotenuse and employing [[calculus]].{{cite journal |last= Staring |first= Mike |date= 1996 |title= The Pythagorean proposition: A proof by means of calculus |journal= Mathematics Magazine |publisher= Mathematical Association of America |volume= 69 |number= 1 |pages= 45–46 |doi= 10.2307/2691395 |jstor= 2691395 }}
{{harvp|Bogomolny|2016|loc= [https://www.cut-the-knot.org/pythagoras/index.shtml#40 Proof #40] (by M. Hardy).}}{{cite journal |last= Berndt |first= Bruce C. |date= 1988 |title= Ramanujan – 100 years old (fashioned) or 100 years new (fangled)? |journal= The Mathematical Intelligencer |volume= 10 |pages= 24–31 |doi= 10.1007/BF03026638 |issue= 3 |s2cid= 123311054 }}
The triangle {{mvar|ABC}} is a right triangle, as shown in the upper part of the diagram, with {{mvar|BC}} the hypotenuse. At the same time the triangle lengths are measured as shown, with the hypotenuse of length {{mvar|y}}, the side {{mvar|AC}} of length {{mvar|x}} and the side {{mvar|AB}} of length {{mvar|a}}, as seen in the lower diagram part.
[[File:Pythag differential proof.svg|thumb|Diagram for differential proof]]
If {{mvar|x}} is increased by a small amount {{mvar|dx}} by extending the side {{mvar|AC}} slightly to {{mvar|D}}, then {{mvar|y}} also increases by {{mvar|dy}}. These form two sides of a triangle, {{mvar|CDE}}, which (with {{mvar|E}} chosen so {{mvar|CE}} is perpendicular to the hypotenuse) is a right triangle approximately similar to {{mvar|ABC}}. Therefore, the ratios of their sides must be the same, that is:
This can be rewritten as {{math|1= ''y'' ''dy'' = ''x'' ''dx''}}, which is a [[differential equation]] that can be solved by direct integration:
giving
The constant can be deduced from {{math|1=''x'' = 0}}, {{math|1=''y'' = ''a''}} to give the equation
This is more of an intuitive proof than a formal one: it can be made more rigorous if proper limits are used in place of {{mvar|dx}} and {{mvar|dy}}.
==Converse==
The [[Theorem#Converse|converse]] of the theorem is also true:{{harvp|Sally|Sally|2007|pp= [https://books.google.com/books?id=nHxBw-WlECUC&pg=PA54 54–55]|loc= Theorem 2.4 (Converse of the Pythagorean theorem).}}
{{blockquote|Given a triangle with sides of length {{mvar|a}}, {{mvar|b}}, and {{mvar|c}}, if {{math|''a''2 + ''b''2 {{=}} ''c''2}}, then the angle between sides {{mvar|a}} and {{mvar|b}} is a [[right angle]].}}
For any three positive [[real numbers]] {{mvar|a}}, {{mvar|b}}, and {{mvar|c}} such that {{math|''a''2 + ''b''2 {{=}} ''c''2}}, there exists a triangle with sides {{mvar|a}}, {{mvar|b}} and {{mvar|c}} as a consequence of the [[triangle inequality#Converse|converse of the triangle inequality]].
This converse appears in Euclid's ''Elements'' (Book I, Proposition 48): "If in a triangle the square on one of the sides equals the sum of the squares on the remaining two sides of the triangle, then the angle contained by the remaining two sides of the triangle is right."[http://aleph0.clarku.edu/~djoyce/java/elements/bookI/propI48.html Euclid's Elements, Book I, Proposition 48] From [http://aleph0.clarku.edu/~djoyce/java/elements/elements.html D.E. Joyce's web page] at Clark University
It can be proved using the [[law of cosines]] or as follows:
Let {{mvar|ABC}} be a triangle with side lengths {{mvar|a}}, {{mvar|b}}, and {{mvar|c}}, with {{math|''a''2 + ''b''2 {{=}} ''c''2.}} Construct a second triangle with sides of length {{mvar|a}} and {{mvar|b}} containing a right angle. By the Pythagorean theorem, it follows that the hypotenuse of this triangle has length {{tmath|1=\textstyle c = \sqrt{a^2 + b^2} }}, the same as the hypotenuse of the first triangle. Since both triangles' sides are the same lengths {{mvar|a}}, {{mvar|b}} and {{mvar|c}}, the triangles are [[congruence (geometry)|congruent]] and must have the same angles. Therefore, the angle between the side of lengths {{mvar|a}} and {{mvar|b}} in the original triangle is a right angle.
The above proof of the converse makes use of the Pythagorean theorem itself. The converse can also be proved without assuming the Pythagorean theorem.Casey, Stephen, "The converse of the theorem of Pythagoras", ''[[Mathematical Gazette]]'' 92, July 2008, 309–313.Mitchell, Douglas W., "Feedback on 92.47", ''Mathematical Gazette'' 93, March 2009, 156.
A [[corollary]] of the Pythagorean theorem's converse is a simple means of determining whether a triangle is right, obtuse, or acute, as follows. Let {{mvar|c}} be chosen to be the longest of the three sides and {{math|''a'' + ''b'' > ''c''}} (otherwise there is no triangle according to the [[triangle inequality]]). The following statements apply:{{cite book |last1= Wilczynski |first1= Ernest Julius |last2= Slaught |first2= Herbert Ellsworth |date= 1914 |title= Plane Trigonometry and Applications |page= [https://archive.org/details/planetrigonomet00wilcgoog/page/n100 85] |url= https://archive.org/details/planetrigonomet00wilcgoog |chapter= Theorem 1 and Theorem 2 |publisher= Allyn and Bacon |author2-link= Herbert Ellsworth Slaught}}
* If {{math|''a''2 + ''b''2 {{=}} ''c''2,}} then the [[Right triangle|triangle is right]].
* If {{math|''a''2 + ''b''2 > ''c''2,}} then the [[Acute Triangle|triangle is acute]].
* If {{math|''a''2 + ''b''2 < ''c''2,}} then the [[Acute and obtuse triangles|triangle is obtuse]].
[[Edsger W. Dijkstra]] has stated this proposition about acute, right, and obtuse triangles in this language:
where {{mvar|α}} is the angle opposite to side {{mvar|a}}, {{mvar|β}} is the angle opposite to side {{mvar|b}}, {{mvar|γ}} is the angle opposite to side {{mvar|c}}, and sgn is the [[sign function]].{{cite web |last= Dijkstra |first= Edsger W. |date= September 7, 1986 |title= On the theorem of Pythagoras |author-link= Edsger W. Dijkstra |work= EWD975 |publisher= E. W. Dijkstra Archive |url= https://www.cs.utexas.edu/users/EWD/transcriptions/EWD09xx/EWD975.html }}
==Consequences and uses of the theorem==
===Pythagorean triples===
{{Main|Pythagorean triple}}
{{See also|Formulas for generating Pythagorean triples}}
A Pythagorean triple has three positive integers {{mvar|a}}, {{mvar|b}}, and {{mvar|c}}, such that {{math|''a''2 + ''b''2 {{=}} ''c''2}}. In other words, a Pythagorean triple represents the lengths of the sides of a right triangle where all three sides have integer lengths. Such a triple is commonly written {{math|(''a'', ''b'', ''c'')}}. Some well-known examples are {{math|(3, 4, 5)}} and {{math|(5, 12, 13)}}.
A primitive Pythagorean triple is one in which {{mvar|a}}, {{mvar|b}} and {{mvar|c}} are [[coprime]] (the [[greatest common divisor]] of {{mvar|a}}, {{mvar|b}}, and {{mvar|c}} is 1).
The following is a list of primitive Pythagorean triples with values less than 100:
{{block indent|left=1.6|1=
{{math|(3, 4, 5),}} {{math|(5, 12, 13),}} {{math|(7, 24, 25),}} {{math|(8, 15, 17),}} {{math|(9, 40, 41),}} {{math|(11, 60, 61),}} {{math|(12, 35, 37),}} {{math|(13, 84, 85),}} {{math|(16, 63, 65),}} {{math|(20, 21, 29),}} {{math|(28, 45, 53),}} {{math|(33, 56, 65),}} {{math|(36, 77, 85),}} {{math|(39, 80, 89),}} {{math|(48, 55, 73),}} {{math|(65, 72, 97)}}
}} There are many [[formulas for generating Pythagorean triples]]. Of these, '''Euclid's formula''' is the most well-known: given arbitrary positive integers {{mvar|m}} and {{mvar|n}}, the formula states that the integers forms a Pythagorean triple. ===Inverse Pythagorean theorem=== Given a [[right triangle]] with sides and [[Altitude (triangle)|altitude]] {{mvar|d}} (a line from the right angle and perpendicular to the [[hypotenuse]] {{mvar|c}}). The Pythagorean theorem has, while the [[inverse Pythagorean theorem]] relates the two [[Cathetus|legs]] {{mvar|a, b}} to the altitude {{mvar|d}},{{cite web |last= Bogomolny |first= Alexander |date= 2018 |title= Pythagorean Theorem for the Reciprocals |work= Cut the Knot |url= https://www.cut-the-knot.org/pythagoras/PTForReciprocals.shtml |access-date= 10 November 2025 |archive-url= https://web.archive.org/web/20241203193356/https://www.cut-the-knot.org/pythagoras/PTForReciprocals.shtml |archive-date= 2024-12-03 }} The equation can be transformed to: where {{math|1= ''x''{{sup|2}} + ''y''{{sup|2}} = ''z''{{sup|2}}}} for any non-zero [[Real number|real]] {{mvar|x, y , z}}. If the {{mvar|a, b, d}} are to be [[integer]]s, the smallest solution {{math|''a'' > ''b'' > ''d''}} is then using the smallest Pythagorean triple {{math|3, 4, 5}}. The reciprocal Pythagorean theorem is a special case of the [[optic equation]] where the denominators are squares and also for a [[heptagonal triangle]] whose sides {{mvar|p, q, r}} are square numbers. ===Incommensurable lengths=== [[File:Euclid Corollary 5.svg|thumb|The [[spiral of Theodorus]]: A construction for line segments with lengths whose ratios are the square root of a positive integer]] One of the consequences of the Pythagorean theorem is that line segments whose lengths are [[Commensurability (mathematics)|incommensurable]] (so the ratio of which is not a [[rational number]]) can be constructed using a [[Compass and straightedge constructions|straightedge and compass]]. Pythagoras's theorem enables construction of incommensurable lengths because the hypotenuse of a triangle is related to the sides by the [[square root]] operation. The figure on the right shows how to construct line segments whose lengths are in the ratio of the square root of any positive integer.{{cite book |last= Law |first= Henry |date= 1853 |title= The Elements of Euclid: with many additional propositions, and explanatory notes, to which is prefixed an introductory essay on logic |publisher= John Weale |chapter-url= https://books.google.com/books?id=Ssb_OnVOGLgC&pg=PA49 |page= 49 |chapter= Corollary 5 of Proposition XLVII (''Pythagoras's Theorem'')}} Each triangle has a side (labeled "1") that is the chosen unit for measurement. In each right triangle, Pythagoras's theorem establishes the length of the hypotenuse in terms of this unit. If a hypotenuse is related to the unit by the square root of a positive integer that is not a perfect square, it is a realization of a length incommensurable with the unit, such as {{tmath|\sqrt2}}, {{tmath|\sqrt3}}, {{tmath|\sqrt5}}. For more detail, see [[Quadratic irrational]]. Incommensurable lengths conflicted with the Pythagorean school's concept of numbers as only whole numbers. The Pythagorean school dealt with proportions by comparison of integer multiples of a common subunit.{{cite book |last= Lavine |first= Shaughan |date= 1994 |title= Understanding the infinite |publisher=Harvard University Press |page= 13 |isbn= 0-674-92096-1 |url= https://books.google.com/books?id=GvGqRYifGpMC&pg=PA13 }} According to one legend, [[Hippasus|Hippasus of Metapontum]] ({{circa|470 BC}}) was drowned at sea for making known the existence of the irrational or incommensurable.{{harvp|Heath|1921|loc= Vol I, pp. 65}}; Hippasus was on a voyage at the time, and his fellows cast him overboard. See {{cite journal |last= Choike |first= James R. |date= 1980 |title= The Pentagram and the Discovery of an Irrational Number |journal= The College Mathematics Journal |volume= 11 |pages= 312–316 }} [[Kurt von Fritz]] wrote a careful discussion of Hippasus's contributions.{{sfnp|Fritz|1945}} ===Complex numbers=== [[File:Complex conjugate picture.svg|right|thumb|The absolute value of a complex number {{mvar|z}} is the distance {{mvar|r}} from {{mvar|z}} to the origin.]] For any [[complex number]] the [[absolute value]] or modulus is given by So the three quantities, {{mvar|r}}, {{mvar|x}} and {{mvar|y}} are related by the Pythagorean equation, Note that {{mvar|r}} is defined to be a positive number or zero but {{mvar|x}} and {{mvar|y}} can be negative as well as positive. Geometrically {{mvar|r}} is the distance of the {{mvar|z}} from zero or the origin {{mvar|O}} in the [[complex plane]]. This can be generalised to find the distance between two points, {{math|''z''1}} and {{math|''z''2}} say. The required distance is given by so again they are related by a version of the Pythagorean equation, ===Euclidean distance=== {{main|Euclidean distance}} The distance formula in [[Cartesian coordinates]] is derived from the Pythagorean theorem.{{cite book |title=Mastering algorithms with Perl |author1=Jon Orwant |author2=Jarkko Hietaniemi |author3=John Macdonald |chapter-url=https://books.google.com/books?id=z9xMfXGoWd0C&pg=PA426 |page=426 |chapter=Euclidean distance |isbn=1-56592-398-7 |year=1999 |publisher=O'Reilly Media, Inc.}} If {{math|(''x''1, ''y''1)}} and {{math|(''x''2, ''y''2)}} are points in the plane, then the distance between them, also called the [[Euclidean distance]], is given by More generally, in [[Euclidean space|Euclidean {{mvar|n}}-space]], the Euclidean distance between two points, and , is defined, by generalization of the Pythagorean theorem, as: If instead of Euclidean distance, the square of this value (the [[squared Euclidean distance]], or SED) is used, the resulting equation avoids square roots and is simply a sum of the SED of the coordinates: The squared form is a smooth, [[convex function]] of both points, and is widely used in [[optimization theory]] and [[statistics]], forming the basis of [[least squares]]. ===Euclidean distance in other coordinate systems=== If Cartesian coordinates are not used, for example, if [[polar coordinates]] are used in two dimensions or, in more general terms, if [[curvilinear coordinates]] are used, the formulas expressing the Euclidean distance are more complicated than the Pythagorean theorem, but can be derived from it. A typical example where the straight-line distance between two points is converted to curvilinear coordinates can be found in the [[Legendre polynomials#Applications of Legendre polynomials in physics|applications of Legendre polynomials in physics]]. The formulas can be discovered by using Pythagoras's theorem with the equations relating the curvilinear coordinates to Cartesian coordinates. For example, the polar coordinates {{math|(''r'', ''θ'')}} can be introduced as: Then two points with locations {{math|(''r''1, ''θ''1)}} and {{math|(''r''2, ''θ''2)}} are separated by a distance {{mvar|s}}: Performing the squares and combining terms, the Pythagorean formula for distance in Cartesian coordinates produces the separation in polar coordinates as: using the trigonometric [[List of trigonometric identities#Product-to-sum and sum-to-product identities|product-to-sum formulas]]. This formula is the [[#Law of cosines|law of cosines]], sometimes called the generalized Pythagorean theorem.{{harvp|Wentworth|Smith|1914|p=116}}: "the Law of Cosines may be stated as follows: [...] In other words we have the Pythagorean Theorem as a special case. Hence this is sometimes called the ''Generalized Pythagorean Theorem''." From this result, for the case where the radii to the two locations are at right angles, the enclosed angle {{math|Δ''θ'' {{=}} {{pi}}/2,}} and the form corresponding to Pythagoras's theorem is regained: The Pythagorean theorem, valid for right triangles, therefore is a special case of the more general law of cosines, valid for arbitrary triangles. ===Pythagorean trigonometric identity=== {{Main|Pythagorean trigonometric identity}} [[File:Trig functions.svg|thumb|Similar right triangles showing sine and cosine of angle θ]] In a right triangle with sides {{mvar|a}}, {{mvar|b}} and hypotenuse {{mvar|c}}, [[trigonometry]] determines the [[sine]] and [[cosine]] of the angle {{mvar|θ}} between side {{mvar|a}} and the hypotenuse as: From that it follows: where the last step applies Pythagoras's theorem. This relation between sine and cosine is sometimes called the fundamental Pythagorean trigonometric identity. {{cite book |title=PreCalculus the Easy Way |author=Lawrence S. Leff |url=https://archive.org/details/precalculuseasyw00lawr |url-access=registration |page=[https://archive.org/details/precalculuseasyw00lawr/page/296 296] |isbn=0-7641-2892-2 |edition=7th |publisher=Barron's Educational Series |year=2005}} In similar triangles, the ratios of the sides are the same regardless of the size of the triangles, and depend upon the angles. Consequently, in the figure, the triangle with hypotenuse of unit size has opposite side of size {{math|sin ''θ''}} and adjacent side of size {{math|cos ''θ''}} in units of the hypotenuse. ===Relation to the cross product=== [[File:Cross product parallelogram.svg|right|thumb|The area of a parallelogram as a cross product; vectors {{math|'''a'''}} and {{math|'''b'''}} identify a plane and {{math|'''a''' × '''b'''}} is normal to this plane.]] The Pythagorean theorem relates the [[cross product]] and [[dot product]] in a similar way: {{cite journal |doi=10.2307/2323537 |title=Cross products of vectors in higher-dimensional Euclidean spaces |author=WS Massey |journal=The American Mathematical Monthly |volume=90 |date=Dec 1983 |pages=697–701 |jstor=2323537 |issue=10 |publisher=Mathematical Association of America |s2cid=43318100 |url=https://pdfs.semanticscholar.org/1f6b/ff1e992f60eb87b35c3ceed04272fb5cc298.pdf |archive-url=https://web.archive.org/web/20210226011747/https://pdfs.semanticscholar.org/1f6b/ff1e992f60eb87b35c3ceed04272fb5cc298.pdf |url-status=dead |archive-date=2021-02-26 }} This can be seen from the definitions of the cross product and dot product, as with {{math|'''n'''}} a [[unit vector]] normal to both {{math|'''a'''}} and {{math|'''b'''}}. The relationship follows from these definitions and the Pythagorean trigonometric identity. This can also be used to define the cross product. By rearranging the following equation is obtained This can be considered as a condition on the cross product and so part of its definition, for example in [[seven-dimensional cross product|seven dimensions]].{{cite book |title=Clifford algebras and spinors |author=Pertti Lounesto |chapter-url=https://books.google.com/books?id=kOsybQWDK4oC&pg=PA96 |page=96 |chapter=§7.4 Cross product of two vectors |isbn=0-521-00551-5 |year=2001 |publisher=Cambridge University Press |edition=2nd}}{{cite book |title=Methods of applied mathematics |author=Francis Begnaud Hildebrand |page=24 |url=https://books.google.com/books?id=17EZkWPz_eQC&pg=PA24|isbn=0-486-67002-3 |edition=Reprint of Prentice-Hall 1965 2nd|publisher=Courier Dover Publications |year=1992}} ===As an axiom=== {{main|Parallel postulate}} If the first four of the [[Euclidean geometry#Axioms|Euclidean geometry axioms]] are assumed to be true then the Pythagorean theorem is equivalent to the fifth. That is, [[Euclid's fifth postulate]] implies the Pythagorean theorem and vice-versa. ==Generalizations== ===Similar figures on the three sides=== The Pythagorean theorem generalizes beyond the areas of squares on the three sides to any [[similar figures]]. This was known by [[Hippocrates of Chios]] in the 5th century BC,Heath, T. L., ''A History of Greek Mathematics'', Oxford University Press, 1921; reprinted by Dover, 1981. and was included by [[Euclid]] in his ''[[Euclid's Elements|Elements]]'':Euclid's ''Elements'': Book VI, Proposition VI 31: "In right-angled triangles the figure on the side subtending the right angle is equal to the similar and similarly described figures on the sides containing the right angle." {{blockquote|If one erects similar figures (see [[Euclidean geometry]]) with corresponding sides on the sides of a right triangle, then the sum of the areas of the ones on the two smaller sides equals the area of the one on the larger side.}} This extension assumes that the sides of the original triangle are the corresponding sides of the three congruent figures (so the common ratios of sides between the similar figures are {{math|''a'' : ''b'' : ''c''}}).{{cite journal |last1= Putz |first1= John F. |last2= Sipka |first2= Timothy A. |date= September 2003 |title= On generalizing the Pythagorean theorem |journal= The College Mathematics Journal |volume= 34 |number= 4 |pages= 291–295 |doi= 10.1080/07468342.2003.11922020 }} While Euclid's proof only applied to convex polygons, the theorem also applies to concave polygons and even to similar figures that have curved boundaries (but still with part of a figure's boundary being the side of the original triangle). The basic idea behind this generalization is that the area of a plane figure is [[Proportionality (mathematics)|proportional]] to the square of any linear dimension, and in particular is proportional to the square of the length of any side. Thus, if similar figures with areas {{mvar|A}}, {{mvar|B}} and {{mvar|C}} are erected on sides with corresponding lengths {{mvar|a}}, {{mvar|b}} and {{mvar|c}} then: But, by the Pythagorean theorem, {{math|1=''a''2 + ''b''2 = ''c''2}}, so {{math|1=''A'' + ''B'' = ''C''}}. Conversely, if we can prove that {{math|1=''A'' + ''B'' = ''C''}} for three similar figures without using the Pythagorean theorem, then we can work backwards to construct a proof of the theorem. For example, the starting center triangle can be replicated and used as a triangle {{mvar|C}} on its hypotenuse, and two similar right triangles ({{mvar|A}} and {{mvar|B}} ) constructed on the other two sides, formed by dividing the central triangle by its [[Altitude (triangle)|altitude]]. The sum of the areas of the two smaller triangles therefore is that of the third, thus {{math|1=''A'' + ''B'' = ''C''}} and reversing the above logic leads to the Pythagorean theorem {{math|1=''a''2 + ''b''2 = ''c''2}}. (''See also {{sectionlink|#Proof by dissection and scaling}}'') {| | [[File:Pythagoras applied to similar triangles.svg|thumb|Generalization for similar triangles,