<s>[INST] Find all values x, y and z which satisfy the equation $(x^2 + 1)(y^2 + 1) = z^2 + 1$ given that $(x^2 + 1)$ and $(y^2 + 1)$ are both primes. Find all positive integers x, y, z which satisfy the equation $(x^2 + 1)(y^2 + 1) = z^2 + 1$ given that $(x^2 + 1)$ and $(y^2 + 1)$ are both primes.
It seems trivial that the only set of integers x, y and z that work are $(1^2 + 1)(2^2 + 1) = 3^2 + 1$, which is equivalent to $2 * 5 = 10$, but how would I go about proving this, or are there any other sets for which the following equation works out?
Thanks in advance.
 [/INST] Odd primes: We first take care of the case $x^2+1$, $y^2+1$ both odd primes.  If $x^2+1$ and $y^2+1$ are odd, then $x$, $y$, and $z$ are even.  
Factor in the Gaussian integers. We get 
$$(x-i)(x+i)(y-i)(y+i)=(z-i)(z+i).$$
Note that $x\pm i$ and $y\pm i$ are Gaussian primes. And since $z$ is even, the Gaussian integers $z-i$ and $z+i$ are relatively prime.
The Gaussian prime $x-i$ divides one of $z-i$ or $z+i$. The same remark applies to all the other Gaussian primes on the left. And we cannot have, for example, both $x-i$ and $x+i$ dividing $z-i$, else $x^2+1$ would, but it doesn't. Similarly, $y-i$ and $y+i$ cannot both divide $z-i$. Similar comments can be made about $z+i$.
It follows that $z-i$ is a unit times one of the products $(x-i)(y-i)$ or $(x-i)(y+i)$ or $(x+i)(y-i)$ or $(x+i)(y+i)$.  
The arguments for all four cases are now essentially the same. Consider the first case, $(x-i)(y-i)$ equal to a unit times $z-i$. We have $(x-i)(y-i)=xy+1-i(x+y)$. Suppose that this is equal to a unit $\epsilon$ times $z-i$. Then
$$xy+1-i(x+y)=\epsilon(z-i).$$
If $\epsilon=\pm 1$, we are in trouble because $xy+1$ is odd and $\epsilon z$ is even. If $\epsilon=\pm i$, then $xy+1=\pm 1$, which is impossible.  
One prime even: This is the case $x=1$. We get the Gaussian factorization $(1-i)(1+i)(y-i)(y+i)=(z-i)(z+i)$. The same argument as the one above shows that $z-i$ is a unit times $(1-i)(y\pm i)$. Multiplying out $(1-i)(y\pm i)$, we reach the conclusion that $y=\pm 2$. For example, if $z-i$ is a unit times $(1-i)(y+i)$, it is a unit times $1+y+i(1-y)$. If the unit is  $\pm 1$, we get $1-y=\mp 1$. And if the unit is $\pm i$, then $1+y=\mp 1$.
. 
</s>