Let (x2+y)(y2+x)=p5, where p is a prime. Then x2+y=ps, y2+x=pt, where {s,t}={1,4} or {2,3}. In the first case we can assume without loss of generality that x<y, x2+y=p and y2+x=p4. Then p2=(x2+y)2>x+y2=p4, a contradiction.
Let x<y, x2+y=p2 and y2+x=p3. Note that p>x. We have p2∣(x2+y)(x2−y)+(y2+x)=x4+x=x(x+1)(x2−x+1) and since p>x we see that p2 divides (x+1)(x2−x+1). We consider two cases.
*Case 1.* If p∣x+1 then p=x+1 and we easily find the solution x=2,y=5.
*Case 2.* If p∤x+1 then p2∣x2−x+1 and now p2∣x2+y=(x2−x+1)+(x+y−1) implies that p2 divides x+y−1. Hence y≥p2−x+1>p2−p and p3=y2+x>p2(p−1)2 which is impossible.
Finally, the solutions are (2, 5) and (5, 2).