Parametrization of a conic and rational solutions How can we parametrize the conic $C$: $x^2+y^2 = 5$, by considering a variable line through $(2,1)$ and hence all rational solutions of $x^2 + y^2 = 5$?
I'm thinking let $x = \sqrt{5}\cos t$, and $y = \sqrt{5} \sin t$, and somehow I need to get the coordinates $(2,1)$ in also.
 A: What you need to do is this:
Find the equation of a line through $(2,1)$ whose gradient $t$ is a rational number. You should get $y-1 = t(x-2)$.
Take a moment to visualise what is happening. As $t$ increases from large and negative, to large and positive, this line rotates about $(2, 1)$, through almost a half turn. We need to find the other intersection of the line and the conic.
We can do that by substituting for $y$, in your original equation; that gives us a quadratic equation in $x$, for any given value of $t$. We already know one of the roots of this quadratic, since it must be satisfied by $x=2$, since the line and your conic both go through $(2,1)$.
The quadratic you get is $$x^2(1+t^2) + x(-4t^2+2t) + 4t^2-4t-4 = 0$$
Using algebraic long division, we can therefore factorise this to get
$$\big[x-2\big]\big[x(1+t^2) -2t^2+2t+2\big] = 0$$
So the other root is given by $$x = \frac{2(t^2-t-1)}{1+t^2}$$
and then, using the fact that $y = tx-2t+1$ with a bit of algebra, we get
$$y = \frac{-t^2-4t+1}{1+t^2}$$
You can double-check that $x^2+y^2=5$, and thus we have a parametrisation giving the rational points on your curve, by taking rational values for $t$.
A: In General formula generic for Pythagorean triples looks a little different.
$$x^2+y^2=az^2$$
If the number can be represented as a sum of squares.  $a=t^2+k^2$
The solution has the form:
$$x=-tp^2+2kps+ts^2$$
$$y=kp^2+2tps-ks^2$$
$$z=p^2+s^2$$
