User:Quantling/testpage

The task of finding primitive Pythagorean triples is closely related to finding rational solutions to $$Q(\vec{r}) = r_1^2 + r_2^2 - 1 = 0\,.$$ If one has one rational solution to this equation, it can be used to find all rational solutions according to the following procedure. Let $$\vec{r}$$ be one rational solution for $$Q(\vec{r}) = 0$$; for example, we could choose $$\vec{r} = (0, 1)$$. Let $$\vec{\imath} = (m, n)$$ be any vector with integer components that do not share a common integer divisor greater than 1; we will use it to find a solution $$\vec{s}$$ for $$Q(\vec{s}) = 0$$. We will look at $$\vec{s}$$ of the form $$\vec{s} = \vec{r} + \lambda\vec{i}$$ for some rational value of $$\lambda$$.

We note that

$$Q(\vec{r} + \lambda\vec{\imath}) = A \lambda^2 + B \lambda + C$$

for some rational values $$A$$, $$B$$, and $$C$$ that depend upon $$\vec{r}$$ and $$\vec{\imath}$$ but not upon $$\lambda$$. Because $$\vec{r}$$ is a solution for $$Q(\vec{r}) = 0$$ we know that $$\lambda = 0$$ makes the left-hand side vanish. It must therefore make the right-hand side vanish, so that gives us that $$C = 0$$. We will prohibit those values of $$\vec{\imath}$$ that give $$A = 0$$. We choose $$\lambda = -B/A$$ because that is the only other solution to the equation $$A \lambda^2 + B \lambda = 0$$. The choice of $$\vec{\imath}$$ gives us $$A$$, $$B$$, $$\lambda$$, and a solution $$\vec{s} = \vec{r} + \lambda\vec{i}$$ for $$Q(\vec{s}) = 0$$.

Furthermore this can be reversed. For any starting rational solution $$\vec{r}$$, any rational solution $$\vec{s}$$ can always be discovered by this procedure by judiciously choosing $$\vec{\imath}$$. Specifically, compute $$\vec{s} - \vec{r}$$, which will be a vector with rational components, and then multiply the whole vector by the smallest positive rational number that makes every component be an integer. (In the case of $$\vec{s} = \vec{r}$$, use $$\vec{\imath} = (0,1)$$.)

Thus regardless of our choice of solution $$\vec{r}$$, we have shown both (1) that every $$\vec{\imath}$$ leads to a solution $$\vec{s}$$, and (2) every solution $$\vec{s}$$ can be achieved with some $$\vec{\imath}$$.

For example, starting with $$\vec{r} = (0,1)$$ for $$Q(\vec{r}) = r_1^2 + r_2^2 - 1$$ and $$\vec{i} = (m,n)$$ gives the formula for deriving Pythagorean triples described earlier.

Note that other quadratic equations with rational solutions can be handled similarly. Thee include $$\begin{align} & r_1^2 + r_2^2 + r_3^2 - 1 = 0 \\ & r_1^2 + r_2^2 - r_3^2 - r_4^2 = 0 \\ & r_1^2 + 2 r_2^2 + 3 r_3^2 - 4 = 0 \\ & r_1^2 + r_1 + r_2^2 - 3 = 0 \\ & r_1 r_2 + r_2 r_3 + r_3 r_1 - 1 = 0\,, \end{align} $$ where the last of these describes the relationship among the three half-angle tangents of the interior angles of a Heronian triangle. To follow the above procedure, the vector of integers $$\vec{\imath}$$ should have as many components as $$\vec{r}$$ does.