# $\alpha x^2+\beta y^2=\gamma$ solvable over $\mathbb Q$ iff $ax^2+by^2=z^2$ solvable over $\mathbb Z$ with coprime $x,y,z$?

I want to understand an algorithm from [1] to solve

$$\alpha x^2+\beta y^2=\gamma \text{ over } \mathbb{Q}$$

with $\alpha, \beta, \gamma\in\mathbb{Q}$. As far is I understood the process the following happens: Multiply the equation by the $\gcd$ of the denominators of $\alpha, \beta, \gamma$ to obtain an equation

$$\alpha x^2+\beta y^2=\gamma$$

where $\alpha, \beta, \gamma\in\mathbb Z$. We may furthermore assume that $\alpha$ and $\beta$ are square free, since else we can solve the equation

$$\bar{\alpha}x'^2+\bar{\beta}y'^2=\gamma$$

where $\bar{\alpha}, \bar{\beta}$ are the nonsquare-parts of $\alpha$ and $\beta$ and with new variables $x'=(\tilde{\alpha}x)^2$ and $y'=(\tilde{\alpha}y)^2$ where $\tilde{\alpha}$ and$\tilde{\beta}$ are the square parts of $\alpha$ and $\beta$. So without loss of generalty, we are left with an equation

$$\alpha x^2+\beta y^2=\gamma \text{ over } \mathbb{Q}$$

where $\alpha, \beta, \gamma\in\mathbb Z$ and $\alpha, \beta$ are square free.

But now the magic happens: This equation should be solvable if and only if an equation

$$ax^2+by^2=z^2$$

is solvable over $\mathbb Z$ with coprime $x,y,z$. Unfortunately I don't see how the coefficients $\alpha$, $\beta$ and $\gamma$ should be related to the coefficient $a$ and $b$ and therefore am not able to understand the equivalence of solving these two equations.

I think that there might be a very easy number-theoretic argument that I don't know and of course it would be awesome if there is indeed an elementary argument for this.

As a remark, that might or might not help: A friend gave me the idea that $z$ could have something to do with the square part $\tilde{\gamma}$ of $\gamma$.

The argument I'm referring to is on page 22 in[1], the middle after "Suppose $\mathbb F=\mathbb Q$".

-

## 1 Answer

The process is homogenization: we switch to integers by introducing a new variable.

Suppose that we are interested in the solvability in rationals $(x,y)$ of $$\alpha x^2+\beta y^2=\gamma,\tag{1}$$ where without loss of generality $\alpha$, $\beta$, and $\gamma$ are integers. Assume $\gamma\ne 0$. There is a rational solution of $(1)$ iff there are integers $u$, $v$, $w$, with $w\ne 0$ such that $\alpha \left(\frac{u}{w}\right)^2+\beta\left(\frac{v}{w}\right)^2=\gamma$, or equivalently $$\alpha u^2+\beta v^2=\gamma w^2.\tag{2}$$

Equation $(2)$ has an integer solution with $w\ne 0$ iff the equation $(\gamma\alpha)u^2+(\gamma\beta)v^2=\gamma^2w^2$ has such a solution.

Or equivalently, Equation $(2)$ has an integer solution with $w\ne 0$ iff the equation $(\gamma\alpha)u^2+(\gamma\beta)v^2=z^2$ has an integer solution with $z\ne 0$. (The $\gamma$ terms on the left force divisibility of $z$ by $\gamma$ since $\gamma$ has no square-part without loss of generality).

-
@born: Thanks for fixing the typo. I should give up on $u$ and $v$, they look too much alike. – André Nicolas Jul 11 '12 at 18:04