# Solutions of Pythagorean Equation/Primitive/Proof 2

## Theorem

The set of all primitive Pythagorean triples is generated by:

$\left({2 m n, m^2 - n^2, m^2 + n^2}\right)$

where:

$m, n \in \Z_{>0}$ are (strictly) positive integers
$m \perp n$, that is, $m$ and $n$ are coprime
$m$ and $n$ are of opposite parity
$m > n$.

## Proof

Let $\left({A, B, C}\right)$ be a Pythagorean Triple:

$A^2 + B^2 = C^2$

By the Pythagorean theorem, this equation describes the sides of a right triangle:

By the definitions of sine and cosine:

 $\displaystyle \sin \theta$ $=$ $\displaystyle \frac A C$ $\displaystyle \cos \theta$ $=$ $\displaystyle \frac B C$

That is,

 $\displaystyle A$ $=$ $\displaystyle C \sin \theta$ $\displaystyle B$ $=$ $\displaystyle C \cos \theta$

Next, we invoke Equiangular Triangles are Similar and Proportion is Equivalence Relation to write:

 $\displaystyle A$ $\propto$ $\displaystyle B \propto C$ $\displaystyle \implies \ \$ $\displaystyle C \sin \theta$ $\propto$ $\displaystyle C \cos \theta \propto C$ from above $\displaystyle \implies \ \$ $\displaystyle \sin \theta$ $\propto$ $\displaystyle \cos \theta \propto 1$ dividing throughout by $C$

We construct the following restriction of $\tan \dfrac \theta 2$.

From Shape of Tangent Function, $\tan \dfrac \theta 2: \left({0 \,.\,.\, \pi}\right) \leftrightarrow \left({0 \,.\,.\, +\infty}\right)$ is a bijection.

Restrict $\tan \dfrac \theta 2$ on this interval so that its image is the set of strictly positive rational numbers:

$\tan \dfrac \theta 2: \tan^{-1}\left[{\Q_{>0}}\right]\cap \left({0 \,.\,.\, \pi}\right) \leftrightarrow \Q_{>0}$

Then $\displaystyle \tan \frac \theta 2 = \frac p q$ for any $\dfrac p q \in \Q_{>0}$, where $\dfrac p q$ is the canonical form of a rational number.

From the Double Angle Formulas:

 $\displaystyle \sin \theta$ $=$ $\displaystyle 2 \sin \frac \theta 2 \cos \frac \theta 2$ $\displaystyle \cos \theta$ $=$ $\displaystyle \cos^2 \frac \theta 2 - \sin^2 \frac \theta 2$ $\displaystyle 2 \sin \frac \theta 2 \cos \frac \theta 2$ $\propto$ $\displaystyle \cos^2 \frac \theta 2 - \sin^2 \frac \theta 2 \propto 1$ substituting into the above proportion $\displaystyle \implies \ \$ $\displaystyle 2\tan \frac \theta 2$ $\propto$ $\displaystyle 1 - \tan^2 \frac \theta 2 \propto \sec^2 \frac \theta 2$ dividing throughout by $\cos^2 \dfrac \theta 2$ $\displaystyle \implies \ \$ $\displaystyle 2 \tan \frac \theta 2$ $\propto$ $\displaystyle 1 - \tan^2 \frac \theta 2 \propto 1 + \tan^2 \frac \theta 2$ Difference of Squares of Secant and Tangent $\displaystyle \implies \ \$ $\displaystyle 2 \frac p q$ $\propto$ $\displaystyle 1 - \left({\frac p q}\right)^2 \propto 1 + \left({\frac p q}\right)^2$ $\displaystyle \implies \ \$ $\displaystyle 2 \frac p q$ $\propto$ $\displaystyle 1 - \frac {p^2}{q^2} \propto 1 + \frac {p^2}{q^2}$ $\displaystyle \implies \ \$ $\displaystyle 2pq$ $\propto$ $\displaystyle q^2 - p^2 \propto q^2 + p^2$ multiplying throughout by $q^2$

Thus these proportions describe the sides of a right triangle:

By the Pythagorean theorem, $\left({2pq,q^2 - p^2, q^2 + p^2}\right)$ is a Pythagorean triple.

That $p, q \in \Z_{>0}$ follows from $\dfrac p q \in \Q_{>0}$.

That $p \perp q$ follows from the assumption that $\dfrac p q$ was written in canonical form.

That every triple is of this form follows from the bijectivity of the tangent function as restricted above.

Recall $q^2 - p^2$ describes the side of a triangle, and so is positive.

Then $q^2 - p^2 > 0$ and therefore $q > p$.

It remains to be proven that:

this triple is primitive
$p$ and $q$ are of opposite parity.

## Historical Note

It is clear from the cuneiform tablet Plimpton $\mathit { 322 }$ that the ancient Babylonians of $2000$ BCE were familiar with this result.

The complete solution of the Pythagorean equation was known to Diophantus of Alexandria.

It forms problem $8$ of the second book of his Arithmetica.

It was in the margin of his copy of Bachet's translation of this where Pierre de Fermat made his famous marginal note that led to the hunt for the proof of Fermat's Last Theorem.