Tag Archives: pell’s equation

Generalization of Pythagoras equation


About 3 years ago I discussed following two Diophantine equations of degree 2:

In this post, we will see a slight generalization of the result involving Pythagorean triplets. Unlike Pythagoras equation, x^2+y^2-z^2=0, we will work with a little bit more general equation, namely: ax^2+by^2+cz^2=0, where a,b,c\in \mathbb{Z}. For proofs, one can refer to section 5.5 of Niven-Zuckerman-Montgomery’s An introduction to the theory of numbers.

Theorem: Let a,b,c\in \mathbb{Z} be non-zero integers such that the product is square free. Then ax^2+by^2+cz^2=0 have a non-trivial solution in integers if and only if a,b,c do not have same sign, and that -bc, -ac, -ab are quadratic residues modulo a,b,c respectively.

In fact, this result helps us determine the existence of a non-trivial solution of any degree 2 homogeneous equation in three variables, f(X,Y,Z)=\alpha_1 X^2 +\alpha_2Y^2+\alpha_3Z^2+\alpha_4XY+\alpha_5YZ+\alpha_6ZX due to the following lemma:

Lemma: There exists a sequence of changes of variables (linear transformations) so that f(X,Y,Z) can be written as an equation of the form g(x,y,z)=ax^2+by^2+cz^2 with \gcd(a,b,c)=1.

Now let’s consider the example. Let f(x,y,z)=3x^2+5y^2+7z^2+9xy+11yz+13zx, and we want to determine whether this f(x,y,z)=0 has a non-trivial solution. Firstly, we will do change of variables:

\displaystyle{f(x,y,z)=3\left(x+\frac{3}{2}y +\frac{13}{6}z\right)^2 - \frac{7}{4}y^2 - \frac{85}{12}z^2 - \frac{17}{2}yz = g(x',y',z')}

where x' = x+\frac{3}{2}y +\frac{13}{6}z, y'=y and z'=z. Thus

\displaystyle{12g(x',y',z')=36x'^2 - 21 y'^2 - 85z'^2 - 102y'z' = 36x'^2 - 21\left(y'+\frac{17}{7}z'\right)^2+\frac{272}{7}z'^2=h(x'',y'',z'')}

where x'' = x',y'' = y'+\frac{17}{7}z' and z''=z'. Thus

\displaystyle{7h(x''',y'',z'') = 252x''^2 - 147y''^2+272z''^2=7(6x'')^2-3(7y'')^2 + 17(4z'')^2 = F(X,Y,Z)}

where X=6x'', Y=7y'' and Z=4z''. Now we apply the theorem to 7X^2-3Y^2+17Z^2=0. Since all the coefficients are prime numbers, we can use quadratic reciprocity to conclude that the given equation has non-trivial solution (only non trivial thing to note that -7\times 17 is quadratic residue mod -3, is same as -7\times 17 is quadratic residue mod 3).