Let the roots of x2+px+q=0 be r and s, with r=s and both integers.
By Vieta's formulas:
r+s=−p
rs=q
Since p and q are primes, −p is the sum of two distinct integers, and q is their product.
Let r and s be distinct integers. Since q is prime, rs=q implies that one of r or s is 1 and the other is q, or one is −1 and the other is −q.
Case 1: r=1, s=q (with q prime, q=1)
Then r+s=1+q=−p⟹p=−(1+q)
But p must be prime, so −(1+q) is prime. Since q is prime ≥2, 1+q≥3, so −(1+q) is negative and prime. The only negative primes are −2,−3,−5,…
So 1+q=2⟹q=1 (not prime), 1+q=3⟹q=2, 1+q=5⟹q=4 (not prime), 1+q=7⟹q=6 (not prime), etc.
So only q=2 gives p=−3 (which is prime).
Check: x2+(−3)x+2=x2−3x+2=(x−1)(x−2), roots 1 and 2 (distinct integers).
Case 2: r=−1, s=−q (with q prime, q=1)
Then r+s=−1−q=−p⟹p=1+q
p must be prime, so 1+q is prime. Try q=2, p=3 (prime), q=3, p=4 (not prime), q=5, p=6 (not prime), q=7, p=8 (not prime), etc.
So only q=2 gives p=3 (prime).
Check: x2+3x+2=(x+1)(x+2), roots −1 and −2 (distinct integers).
Case 3: r=q, s=1 (already considered in Case 1).
Case 4: r=−q, s=−1 (already considered in Case 2).
Therefore, the only pairs (p,q) of prime integers such that the solutions of x2+px+q=0 are two distinct integers are:
(p,q)=(3,2) and (p,q)=(−3,2)