How to find all rational solutions of $\ x^2 + 3y^2 = 7 $? I knew that for $ x^2 + y^2 = 1$ the x and y can be expressed by introducing one more variable where $\ m=y/(x+1) $, then $\ x= 2m/(1+m^2) $ and $\ y= (1-m^2)/(1+m^2) $. What about $\ x^2 + 3y^2 = 7 $, should I divide the equation by 7 in order to get the 1 at the right hand side ? Then how to deal with the $\ 3y^2 $ ? Thank you!
 A: Using the method of pg 7 of this paper on this related equation
$$x^2+3y^2=7z^2 \quad \text{with initial solution} \quad (x,y,z)=(2,1,1)$$
A line $y=t(x-2)+1$, which will cut through the ellipse $x^2 + 3y^2 = 7$ at rational points if $t$ is rational.... when substituted into the ellipse yields:
$$\begin{align}
x^2+3\left[t(x-2)+1\right]^2&=7 \\
x^2+3\left[t^2(x^2-4x+4)+2t(x-2)+1\right]&=7 \\
(1+3t^2)x^2+(-12t^2+6t)x+(12-12t+3-7)&=0 \\
\text{vieta:  the two roots,} \quad x_1, x_2 \quad \text{are such that} 
 \quad -(x_1+x_2)&=\frac{-12t^2+6t}{1+3t^2} \\
\text{since} \quad x_1=2, \quad \text{we have} \quad x_2(t)=\frac{12t^2-6t}{1+3t^2}-2 &=\frac{6t^2-6t-2}{1+3t^2} \\
\text{substituting this} \quad x(t) \quad \text {into the line:} \quad  y&=t\left(\frac{6t^2-6t-2}{1+3t^2}-2\right)+1 \\
y(t)=t\left(\frac{-6t-4}{1+3t^2}\right) + \frac{1+3t^2}{1+3t^2}&=\frac{-3t^2-4t+1}{1+3t^2}
\end{align}$$
Letting $y(t)\to |y(t)|$, Solution set with one parameter: 
$$\begin{cases}
x(t)&=\frac{6t^2-6t-2}{1+3t^2} \\
y(t)&=\frac{3t^2+4t-1}{1+3t^2} 
\end{cases}$$
$t$ was rational, so let $t=\frac{m}{n}$
Solution set now with two parameters:
$$\begin{align}
x(m,n)&=\frac{6m^2-6mn-2n^2}{n^2+3m^2} \\
y(m,n)&=\frac{3m^2+4mn-n^2}{n^2+3m^2} 
\end{align}$$
A: There are only six solutions which are also algebraic integers, and they can each be found from whichever one you discover first.
For instance, $$(2 + \sqrt{-3}) \left( \frac{-1 + \sqrt{-3}}{2} \right) = \frac{-5 + \sqrt{-3}}{2}$$ and $$\frac{-5 + \sqrt{-3}}{2} \left( \frac{-1 + \sqrt{-3}}{2} \right) = \frac{1 - 3 \sqrt{-3}}{2}.$$
There are infinitely many solutions, but for each viable denominator $d$ there are only two or four solutions. For example, from the very strategically withheld solution $$\frac{10}{31} + \frac{47 \sqrt{-3}}{31}$$ (which was inexplicably deleted from this page earlier today) we can obtain $$\omega \left( \frac{10}{31} + \frac{47 \sqrt{-3}}{31} \right) = \frac{151 + 37 \sqrt{-3}}{62}$$ and verify that that number does have a norm of $7$.
A: In general, solving such polynomial equations in rational indeterminates is somewhat easier than solving the corresponding Diophantine equations. To illustrate this statement, consider the following generalization of your equation over any field $K$ of characteristic $\neq 2$ : find all the solutions $x,y\in  K$ of $x^2-by^2=c$ (*), with $ c\neq 0, b\in K$. It is straightforward that a solution $(x_0, y_0)$ exists if and only if $c$ is a norm from the extension $L=K(\sqrt b)$. Assuming this condition, how do we find all the solutions ? There are at least two methods:


*

*the geometric method, as explained by Eric Wofsey, consists in the prametrization of the conic (*) obtained by intersecting it with a "pencil" of lines going through the point $(x_0, y_0)$

*the algebraic method goes on exploiting the norm homomorphism $N:L^* \to K^*$ defined by $N(z)=x^2-by^2$ if $z=x+y\sqrt b$. It is clear that all solutions $z$ will be of the form $z=z_0u$ where $N(u)=1$, so the problem is equivalent to the determination of the kernel of the norm. Here $L/K$ is Galois, with Galois group $C_2$ generated by the "conjugation" $\sigma: \sqrt b \to -\sqrt b$, and Hilbert's thm. 90 (which holds for all cyclic extensions) states $N(u)=1$ if and only if $u$ is of the form $u = v / \sigma v, v\in L^*.$  All (easy) calculations done, we get $u$ of the form   $$u=\frac {\alpha^2 + b \beta^2}{\alpha^2 - b \beta^2} + \frac{2 \alpha\beta}{\alpha^2 - b \beta^2} \sqrt b,$$ hence all the solutions $z=z_0u$. A good exercise would be to recover this formula using the geometric approach.
In your case, take $z_0=2+\sqrt{-3}$, but in general the main task is actually to find a  solution $z_0$. 
Complement 1. In order to allow comparison with other possible types of parametrizations, I carry the calculations through to the end in the problem at hand. It will be convenient to write $z=(x,y)$ for $z=x+y\sqrt{-3}$. In the formula giving $u$ above, $\alpha =0$ (resp. $\beta=0$) iff $u=-1$ (resp. $1$). Putting this case apart, the parametrization can be rewritten as $$u=(\frac {1-3t^2}{1+3t^2}, \frac {2t}{1+3t^2}), t\in \mathbf Q^*$$ Starting from the particular solution $z_0=(2,1)$, we get the family of all solutions $$z=z_0u=\epsilon (\frac {2+6t-6t^2}{1+3t^2},\frac {1+4t-3t^2}{1+3t^2}), \epsilon =\pm 1$$ Thus one recovers the geometric parametrization of AmateurMathPirate, and also the homogeneous prametrization given by -individ. It seems to me that the whole discussion "finite number vs. infinite number of solutions" originates from the assumption that an algebraic number of norm $1$ should be an algebraic unit. This is wrong :  in a quadratic field for instance, a number of norm $\pm 1$ is a unit iff in addition its trace is a rational integer. 
Complement 2. The general problem cannot be considered as settled without giving a criterion for the existence of a rational solution.  A natural first step is to consider $y$ in $(*)$ as a rational parameter and, for a given $y$, check whether $\sqrt {c-by^2}$ is rational. This approach by trials and errors happens to work right away in the particular case here (and over any field of characteristic $\neq 2$), but if unlucky, one could as well waste a life time searching for a solution which does not exist !  Actually a general existence criterion is available over number fields thanks to Hasse's norm theorem in cyclic extensions. Equation (*) is equivalent to $c$ being a norm from $L=K(\sqrt b)$. Denote by $v$ any place of $K$, $w$ any place of $L$ above $v$ (archimedean or not). Hasse's theorem states that $c$ is a norm in $L/K$ iff $c$ is a norm in all the completions $L_w/K_v$. This is useful only if one has an effective criterion for the local normic conditions. For simplicity, let us examine only the case $K=\mathbf Q$. At the archimedean place, the condition is just a question of signs. At a non archimedean place, i.e. over a $p$-adic field $\mathbf Q_p$, it can be expressed in terms of the $p$ - Hilbert symbol <.,.> (with values in $(\pm 1)$), precisely it is equivalent to $<c,b>=1$. It remains to compute the Hilbert symbols. One must consider two separate preliminary cases (see e.g. Serre's "Local Fields", chap. XIV, §4):


*

*the so-called "tame" case with $p$ odd : Write $c=p^{\gamma}c', b=p^{\beta}b'$, then $<c,b>=(-1)^{\frac {p-1}{2}\gamma\beta}(\frac {b'}{p})^{\gamma}(\frac {c'}{p})^{\beta}$, where $(\frac {*}{*})$ is the Legendre symbol

*the so-called "wild" case with $p=2$ : Writing $U$ for the group of units of $\mathbf Q_2$, consider the homomorphisms $\epsilon , \omega : U \to {\mathbf Z}/2$ defined by $\epsilon (u)=\frac {u-1}{2}$ mod $2$ and $\omega (u)=\frac {u^2-1}{8}$ mod $2$. Then $<2,u>=(-1)^{\omega (u)}$ if $u \in U$ and $<u,v>=(-1)^{\epsilon (u)\epsilon (v)}$ if $u, v \in U$. Knowing that the $\mathbf F_2$ vector space $\mathbf Q_2^*/{\mathbf Q_2^*}^2$ has a basis consisting of the classes of $-1, 2, 5$, one can get $<c,b>$ from these special formulas
Note that all in all only finitetely many Hilbert symbols need to be computed, precisely for $p=2$ or $p$ dividing the discriminant of the original quadratic field  ./.
A: The key here is to understand where the substitution $$m = \frac{y}{x + 1}$$ comes from. Geometrically, this variable represents the slope of the line between a point $(x, y)$ and the point $(-1, 0)$.  What you are then doing is considering a rational slope $m$, taking the line $L$ through $(-1,0)$ of slope $m$, and solving for the second intersection point of this line with the conic $x^2+y^2=1$ (the first intersection point being $(-1,0)$).
This same approach works for any conic, as long as you have a single rational point on the conic to play the role of $(-1,0)$. In the case of $x^2+3y^2=7$, for instance, you could take $(2,1)$ as your initial point. So then you would define $$m = \frac{y - 1}{x - 2}$$ and solve for $(x,y)$ as the second point where the line $L$ through $(2,1)$ of slope $m$ intersects the conic $x^2+3y^2=7$.
A: @ The Short One     
Allow me to disagree with your explanation. First, in expressing a solution to the problem under the form $z=x+y\sqrt -3 \in \mathbf Q(\sqrt -3)$ s.t. $N(z)=7$, why do you impose $z$ to be an algebraic integer ? The OP asked only for rational solutions $(x, y)$. Second, the numerical example which you give amounts to $N(z_0\omega)=N(z_0)$, which is obvious since the norm  is multiplicative. The point is that there are infinitely many $u\in\mathbf Q(\sqrt -3)$ s.t. $N(u)=1$ apart from the units (= invertible elements of the ring of integers). Dirichlet's unit theorem gives the structure of the group of units $U_K$ of a number field $K$. In the particular case of an imaginary quadratic field, $U_K$  is finite, actually equal to the group $W_K$ of roots of unity contained in $K$. Here it happens that $W_K$ is of order $6$, consisting of $\pm$ the powers of $\omega$. 
NB. What do you mean precisely by a "viable denominator" ?
At this point it seems necessary to give a detailed proof to convince you that there exists an infinite number of $u=x+y\sqrt b\in \mathbf Q (\sqrt b)$ s.t. $N(u)=1$ (here $b=-3$). Whether by a geometric approach (such as used by Eric Wofsey) or an algebraic one (via Hilbert's thm. 90), one has the parametrization : $x= \pm\frac {1+bt^2}{1-bt^2} ,  y=\pm\frac {2t}{1-bt^2}, t\in \mathbf Q^*$. It follows readily that $u'=u$ iff $t'= t$ and $(t'-t)(btt'-1)=0$, iff  $t'=t$ or $bt^2=-1$ . This shows the announced property. 
