Solution:
First solution. It suffices to consider the case when P and Q≡0 are relatively prime polynomials and the leading coefficient of Q equals 1. We have
x(x+2)(P(x)Q(x+1)−Q(x)P(x+1))=Q(x)Q(x+1)
for infinitely many x, i.e. for every x. Thus the polynomials Q(x) and Q(x+1) divide x(x+2)Q(x+1) and x(x+2)Q(x) respectively.
Therefore S(x)Q(x)=x(x+2)Q(x+1) and T(x)Q(x+1)=x(x+2)Q(x), where S and T are quadratic polynomials with leading coefficients 1. Hence, S(x)T(x)=x2(x+2)2. There are three cases to be considered.
Case 1. S(x)=T(x)=x(x+2). Then Q(x+1)=Q(x), i.e. Q≡1 and the condition of the problem shows that this is impossible.
Case 2. S(x)=x2 and T(x)=(x+2)2. Then xQ(x)=(x+2)Q(x+1). Therefore Q(1)=0 and it follows by induction that Q(n)=0 for all n∈N. Hence Q≡0, a contradiction.
Case 3. S(x)=(x+2)2 and T(x)=x2. Then (x+2)Q(x)=xQ(x+1) and therefore x divides Q(x) and x+2 divides Q(x+1), i.e. x+1 divides Q(x). It follows that Q(x)=x(x+1)Q1(x), where Q1 has leading coefficient 1 and Q1(x+1)=Q1(x). We conclude that Q1(x)=1 and Q(x)=x(x+1). Now plugging Q(x) in (1) gives
(x+2)P(x)−xP(x+1)=x+1
Setting x=0 and x=−1 we obtain P(0)=21 and P(−1)=−21. Therefore P(x)=21+x+x(x+1)P1(x), where P1 is a polynomial. Now (2) implies that P1(x+1)=P1(x) and therefore P1 is a constant.
We conclude that if the polynomials P and Q are relatively prime and a0=1, then Q(x)=x(x+1) and P(x)=21+x+cx(x+1).
Therefore the answer is
Q(x)=x(x+1)R(x) and P(x)=(21+x+cx(x+1))R(x)
where R is an arbitrary nonzero polynomial and c is a constant.
Second solution. The given identity can be written as
Q(x)P(x)−21(x1+x+11)=Q(x+1)P(x+1)−21(x+11+x+21)
Hence it follows by induction that
Q(x)P(x)−21(x1+x+11)=Q(x+n)P(x+n)−21(x+n1+x+n+11)
Fixing x and letting n→∞ we see that Q(x)P(x)−21(x1+x+11)=c, where c is a constant. Now it is easy to conclude that Q(x)=x(x+1)R(x) and P(x)=(21+x+cx(x+1))R(x).