\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}

\title{Worksheet 9}
\author{Math 202}
\date{Wednesday, May 29, 2024}

\hyphenpenalty 2000

\renewcommand \thepage {}

\begin{document}
\maketitle

Together we discussed Pythagorean triples: there's everyone's favorite $3^2 + 4^2 = 5^2$; there's $6^2 + 8^2 = 10^2$ which isn't really new; there's the less famous $5^2 + 12^2 = 13^2$; and we'd like to find more of them.  We saw that this was equivalent to finding points on the unit circle $x^2 + y^2 = 1$ whose coordinates are both rational numbers. \medskip

Stereographic projection gives a correspondence between points on the unit circle and points on the horizontal line shown in this diagram:
\begin{center}
\begin{picture}(60,45)(-30,-15)
  \put(0,0){\oval(40,40)}
  \put(0,-20){\line(0,1){50}}
  \put(0,-20){\line(1,2){25}}
  \put(-30,20){\line(1,0){60}}
  \put(0,20){$\overbrace{}^r$}
  \put(16,12){\circle* 3}
  \put(18,6){$^{(x,y)}$}
  \put(0,0){\circle* 3}
  \put(-18,-8){$^{^{(0,0)}}$}
\end{picture}
\end{center}
Use similar triangles to find a formula for $r$ in terms of $x$ and $y$.  What values of $r$ correspond to $(\tfrac{3}{5},\tfrac{4}{5})$ and $(\tfrac{5}{13}, \tfrac{12}{13})$?  Is it clear from your formula that if $x$ and $y$ are rational numbers, then so is $r$? \medskip
% r / 2 = x / (y+1)
% r = 2x / (y+1)

Now go the other way and find formulas for $x$ and $y$ in terms of $r$.  I recommend taking your answer to the previous question, solving for $y$,
% y = 2x/r - 1
substituting that into $x^2 + y^2 = 1$,
% x^2 + (2x/r - 1)^2 = 1
% x^2 + 4x^2/r^2 - 4x/r + 1 = 1
% r^2 x + 4x - 4r = 0
and solving for $x$.
% x = 4r/(r^2+4)
Then you can get $y$ as well.
% y = 2x/r - 1
%   = 8/(r^2+4) - (r^2+4)/(r^2+4)
%   = (4-r^2)/(4+r^2)
As a sanity check, plug in the values of $r$ that you found earlier and see if you get back $(\tfrac{3}{5},\tfrac{4}{5})$ and $(\tfrac{5}{13}, \tfrac{12}{13})$.  Is it clear from your expressions that if $r$ is a rational number, then so are $x$ and $y$? \medskip

Now plug in some new values of $r$ to get new Pythagorean triples.  Check that they really satisfy $a^2 + b^2 = c^2$.  Observe that you can get infinitely many Pythagorean triples this way. \medskip

Extra: If you like programming, you could write a program to print out lots of Pythagorean triples.

\end{document}

-- Macaulay2 code to check their work:
blit = (x,y) -> ( assert(x^2+y^2 == 1); 2*x/(y+1) )
blat = r -> (4*r/(4+r^2), (4-r^2)/(4+r^2))