Let Q(x)=(x+1)P(x)−x , and clearly, Q(x) has a degree of n+1 .
Then, for k=0,1,2,…,n , Q(k)=(k+1)P(k)−k=(k+1)⋅k+1k−k=0 .
Thus, k=0,1,2,…,n are the roots of Q(x) .
Since these are all n+1 of the roots of the n+1th degree polynomial, by the Factor Theorem , we can write Q(x) as Q(x)=c(x)(x−1)(x−2)⋯(x−n) where c is a constant.
Thus, (x+1)P(x)−x=c(x)(x−1)(x−2)⋯(x−n).
We plug in x=−1 to cancel the (x+1)P(x) and find c :
−(−1)1c=c(−1)(−1−1)(−1−2)⋯(−1−n)=c(−1)n+1(1)(2)⋯(n+1)=(−1)n+1(n+1)!1
Finally, plugging in x=n+1 to find P(n+1) gives:
Q(n+1)(−1)n+1(n+1)!1⋅(n+1)!(−1)n+1(−1)n+1+(n+1)P(n+1)=(n+2)P(n+1)−(n+1)=(n+2)P(n+1)−(n+1)=(n+2)P(n+1)−(n+1)=(n+2)P(n+1)=n+2(−1)n+1+(n+1)
If n is even, this simplifies to P(n+1)=n+2n . If n is odd, this simplifies to P(n+1)=1 . □
~Edits by BakedPotato66