If r=2 we get p4+2p+q4+q2=4q3+5. Then q=2,3 otherwise q≥5 and q4+q2>4q3+5. If q=2 then p4+2p=17 gives no solution. If q=3 we get p4+2p=23 gives no solution. Therefore, r is odd and the right hand side of the main equation is even. Then since 2p+q4+q2=2p+q2(q2+1) is even we get that p4, equivalently p is even: p=2. Thus, the main equation becomes r2=q4+q2−4q3+19.
Now we show that there is no solution if q=2,3,5 since r2 lies between two consecutive perfect squares:
(q2−2q−2)2<r2<(q2−2q−1)2
Indeed, (q2−2q−2)2<r2=q4+q2−4q3+19 is equivalent to (q−5)(q−3)>0 and r2=q4+q2−4q3+19<(q2−2q−1)2 is equivalent to q2+4q>18. Finally, q=2 gives r2=7, q=3 gives r2=1, q=5 gives r=13. The only solution is (2,5,13).