Let's think step by step:
1) For x2 + 2x + 5 to be a factor of x4 + px2 + q, when we divide x4 + px2 + q by x2 + 2x + 5, the remainder should be 0.
2) Dividing x4 + px2 + q by x2 + 2x + 5, the quotient will be x2 and the remainder will be p - 5.
3) For the remainder to be 0, we must have p - 5 = 0.
Therefore, p = 5
4) Putting p = 5 in the original expression, we get:
x4 + 5x2 + q
5) Comparing the constant