Skip to main content

Section 8.8 Application: Pythagorean Triples*

In this section we will classify all Pythagorean Triples, that is, all positive integer solutions to

\begin{equation*} x^2+y^2=z^2\text{.} \end{equation*}

This is a bit more involved than other diophantine problems and harder to figure out on your own on a homework problem (so it is not required reading), but we'll give a proof here since it's a neat application of what we've learned and can test your knowledge of the material in this chapter.

We narrow down the solutions in a few steps:

  • If \(x=0\text{,}\) then we must have \(y^2=z^2\text{,}\) and so \(y=\pm z\text{.}\) Thus, we know all solutions if \(x=0\text{,}\) so let's assume \(x> 0\text{.}\) Similarly, we can assume \(y,z> 0\text{.}\)

  • We can assume that \(x,y\) and \(z\) are coprime (that is, no two of them share a common factor other than \(1\)). To see this, suppose \(d=\gcd(x,y)\text{.}\) Then \(a=x/d\) and \(b=y/d\) are coprime, and then

    \begin{equation*} z^2= x^2+y^2 = d^2(a^2+b^2)\text{.} \end{equation*}

    By TheoremĀ 8.7.2, \(a^2+b^2=c^2\) for some integer \(c\text{,}\) and so \(z^2=d^2 c^2=(cd)^2\text{.}\) Hence, \((x,y,z)=(da,db,dc)\) for some other Pythagorean Triple \((a,b,c)\) where \(a\) and \(b\) are coprime. Thus, if we find all solutions \((x,y,z)\) where \(x\) and \(y\) are coprime, then all other solutions are multiples of these. A similar proof shows that all solutions will be multiples of solutions where \(x\) and \(z\) are coprime and where \(y\) and \(z\) are coprime.

  • Thus, assume \(x,y\text{,}\) and \(z\) are coprime and positive solutions to \(x^2+y^2=z^2\text{.}\) Then either \(x\) or \(y\) is odd, assume it is \(x\text{.}\)

  • We now claim \(z+y\) and \(z-y\) are coprime. Suppose not. Then there is a prime \(q\) that divides them both. But then

    \begin{equation*} q\text{ divides } (z+y)-(z-y) = 2y,\;\; q\text{ divides } (z+y)+(z-y) = 2z\text{.} \end{equation*}

    Since \(y\) and \(z\) are coprime, \(q=2\text{.}\) But then

    \begin{equation*} 2\text{ divides } (z-y)(z+y)=z^{2}-y^{2}=x^{2} \end{equation*}

    which implies \(x\) is even, a contradiction.

  • Since \(z\pm y\) are coprime and \(x^{2}=(z+y)(z-y)\text{,}\) we know that \(z+y=s^{2}\) and \(z-y=t^{2}\) for some integers \(s\) and \(t\) by TheoremĀ 8.7.2. Hence,

    \begin{equation*} z=\frac{z+y+z-y}{2} = \frac{s^{2}+t^{2}}{2} \end{equation*}

    Similarly, \(y=\frac{s^{2}-t^{2}}{2}\text{,}\) and finally,

    \begin{equation*} x^{2} =(z-y)(z+y) = s^{2}t^{2}\text{.} \end{equation*}

    Thus, all positive coprime solutions with \(x\) odd are of the form

    \begin{equation*} (x,y,z) = \left( st, \frac{s^2-t^2}{2}, \frac{s^{2}+t^{2}}{2}\right)\text{.} \end{equation*}
  • Finally, we now recall that all solutions are multiples of these soluitions, thus all Pythagorean Triples are of the form

    \begin{equation*} (x,y,z) = \left( as t, a\frac{s^2-t^2}{2}, a\frac{s^{2}+t^{2}}{2}\right) \end{equation*}

    where \(a,s,t\) are integers.