---
tag: J157D5FVP4
kind: proof
name: Proof of the Pythagorean theorem and its converse with the dot product
msc: [51M04]
proves: 0VP3A1290K
uses: [0CTNFGYMM2, 0GJAJC6TNZ, 0NPPGHQNXQ, 0XKBKGTCPC, 0S52TNNTH9, 03NK6RSRQ1]
sources:
  - url: https://en.wikipedia.org/wiki/Law_of_cosines
    locator: Using vectors
---

## Proof

We expand a squared length, which proves both directions at once.

1. Let $x = A - B$ and $y = C - B$. With the [[Euclidean distance|0NPPGHQNXQ]] and the [[length|0XKBKGTCPC]], $d(A, B) = \norm{x}$, $d(B, C) = \norm{y}$ and $d(A, C) = \norm{x - y}$.
2. The [[dot product|0S52TNNTH9]] is bilinear and symmetric. So $\norm{x - y}^2 = \norm{x}^2 + \norm{y}^2 - 2 \, x \cdot y$.
3. By steps 1 and 2, $d(A, C)^2 = d(A, B)^2 + d(B, C)^2$ holds if and only if $x \cdot y = 0$.
4. The vertices of the [[triangle|0CTNFGYMM2]] are not collinear, so they are distinct. Thus $x \neq 0$ and $y \neq 0$.
5. By definition, the [[angle|0GJAJC6TNZ]] $\angle ABC$ is the angle between $x$ and $y$. Since both are nonzero, $x \cdot y = 0$ holds [[if and only if this angle is $\pi / 2$|03NK6RSRQ1]].
6. Steps 3 and 5 give: $d(A, C)^2 = d(A, B)^2 + d(B, C)^2$ if and only if $\angle ABC = \pi / 2$.

## Idea

The square of the side $AC$ is the sum of the squares of the other two sides, minus twice a dot product. This correction term vanishes exactly when the two sides at $B$ are perpendicular. So one computation gives the theorem and its converse.
