Solve $x^2+y^2=2$ for $x,y\in\mathbb Q$. 
Solve $x^2+y^2=2$ for $x,y\in\mathbb Q$.

I think the answer should be in terms of 1 integer variable $\in\mathbb Z$ only. I rewrite the equation to $(x+y)^2+(x-y)^2=2^2$, then by the formula of pythagorean triples, $x+y=u^2-v^2,x-y=2uv,2=u^2+v^2$. How can I proceed? Thanks.

Solutions to the equation $x^2+y^2=2$ with $x,y\in \mathbb{Q}$ can be parametrized by $$\left(x,y\right)=\left(\frac{1+2t-t^{2}}{1+t^{2}},\ \frac{1-2t-t^{2}}{1+t^{2}}\right),$$ where $t\in \mathbb{Q}$.
This follows by rewriting the equation as $$\left(\frac{x+y}{2}\right)^{2}+\left(\frac{x-y}{2}\right)^{2}=1,$$ and using the parametrization for $u^2+v^2=1$.   Consequently, we see that $$\left(\frac{x+y}{2},\ \frac{x-y}{2}\right)=\left(\frac{1-t^{2}}{1+t^{2}},\ \frac{2t}{1+t^{2}}\right),$$ and so we arrive at  $$\left(x,y\right)=\left(\frac{1+2t-t^{2}}{1+t^{2}},\ \frac{1-2t-t^{2}}{1+t^{2}}\right).$$
