<s>[INST] Number of integer solutions of $a^2+b^2=10c^2$ Find the number of integer solutions of the equation $a^2+b^2=10c^2$.
I can only get by inspection that $a=3m, b=m,c=m$ satisfies for any $m \in Z$.
Is there a formal logic to find all possible solutions? Any hint?
Also i tried taking $a=p^2-q^2$, $b=2pq$ and $10c^2=(p^2+q^2)^2$
which gives $$\frac{p^2+q^2}{c}=\sqrt{10}$$ which is invalid, since a rational can never be an irrational.
 [/INST] We first transform the given equation $a^2+b^2=10c^2$ as follows:
Consider $x=\frac{a}{c}, y=\frac{b}{c}$ (assuming we are interested in $c \neq 0$ case). Then we have to find rational points on the circle
$$x^2+y^2=10.$$
Now $(x,y)=(3,1)$ is an obvious solution. To find other rational solutions, consider the line that passes through $(3,1)$ and has slope $m$. It is given by
$$y=mx+(1-3m).$$
Consider the intersection of this line with the circle $x^2+y^2=10$. We can find the intersection from
$$x^2+(mx+(1-3m))^2=10 \implies (1+m^2)x^2+2m(1-3m)x+(1-3m)^2-10=0.$$
But instead of solving the quadratic, we can argue that if two roots are $x_1$ and $x_2$, then we have $x_1=3$, so by means of Viete formula etc. we have
$$x_1+x_2=-\frac{2m(1-3m)}{1+m^2} \implies x_2=\frac{3m^2-2m-3}{1+m^2}.$$
Now if $m$ is rational then $x_2$ is also rational and so will $y_2$ be, because
$$y_2=\frac{1-m^2-6m}{1+m^2}.$$
Now for $m=\frac{p}{q}$, where $p,q \in \Bbb{Z}$ and $q \neq 0$, we can have
$$\color{blue}{a=3p^2-2pq-3q^2, \quad b=q^2-p^2-6pq, \quad c=p^2+q^2}$$
Now the main question is: this combined with your answer (which can be obtained if we allow $q=0$) is that the totality of all solutions?
</s>