# Can Legendre's theorem really help solve this equation: $ax^2+by^2=cz^2$?

let $a,b,c,x,y$ be non-zero positive integers such that $$\gcd(x,y,z)=1$$ find all the non-trivial integral solutions of the diophantine equation:$$ax^2+by^2=cz^2$$ I know that the Legendre's theorem can be helpful in solving this equation but beyond the insight that this theorem provides into the criteria of solvability, it did not help me get any further. Please help.

• I find it easier to use the formulas. math.stackexchange.com/questions/738446/… – individ Oct 22 '14 at 12:23
• @Individ, Thanks. But there must be a method to get to the formulas. That's what I am interested in. – user97615 Oct 22 '14 at 12:28
• The theorem of Legendre does not give the formula of the solution. It gives a criterion that says when this equation can be solve. – individ Oct 22 '14 at 15:13
• That's my point. How do I get to your formula? – user97615 Oct 22 '14 at 15:23
• No! It is necessary to wait when the article prints. – individ Oct 22 '14 at 15:29

## 2 Answers

There is at least one integer solution $(U,V,W)$ to $a U^2 + b V^2 = c W^2$ with small variables, $a U^2 + b V^2 + c W^2 < 4abc.$

Once you have a single such integer solution, all primitive integer solutions are given by taking $\gcd(m,n) = 1,$ then $$X = -aUm^2 - 2 b V mn + b U n^2, \; \; Y = aVm^2 - 2 a U mn - bV n^2, \; \; Z = (a m^2 + b n^2)W.$$ Then take $$g = \gcd(X,Y,Z),$$ finally $$x = X / g, \; \; y = Y/g, \; \; z = Z /g.$$ Depending upon the actual coefficients $a,b,c,$ it may be possible to predict $g,$ resulting in a finite number of slightly different formulas to give all primitive solutions.

• Like i said I found this form except that small integer solution. That's my challenge. Can you write down one for me? – user97615 Oct 24 '14 at 1:46
• Ok. Thanks. I appreciate your help and honesty. – user97615 Oct 24 '14 at 2:08
• @num, I am missing something...why would you think there was a way to predict a solution to $ax^2 + by^2 = cz^2?$ – Will Jagy Oct 24 '14 at 2:22
• Because Euler found an identity for equations of this form. I just cannot find his approach. – user97615 Oct 24 '14 at 2:39
• @num Sigh. Do you have a reference for the idea that Euler said something about this? – Will Jagy Oct 24 '14 at 2:50

We need to write generally speaking the more General equation:

$$aX^2+bXY+cY^2=jZ^2$$

Although I formula solutions recorded, but I see it is of interest expression solutions using any one of the known solution.

If we know what any one solution: $(x,y,z)$ - then you can write a formula for the solutions of this equation.

$$X=jxt^2-cxk^2+2(cyk-jzt)s+(by+ax)s^2$$

$$Y=jyt^2-2jztk+(cy+bx)k^2+2axks-ays^2$$

$$Z=jzt^2-(bx+2cy)kt+czk^2+(bzk-(2ax+by)t)s+azs^2$$

$k,t,s$ - any integer asked us.

• It's interesting that it is easier to find the general form than one actual solution. Thanks Individ. – user97615 Oct 24 '14 at 10:30
• I am looking for an answer just like Cardano's formula. – user97615 Oct 24 '14 at 10:34