The inverse-Gamma shape trap

Begin with the joint posterior kernel Equation (15) in Bayesian linear regression. Integrate the Gaussian coefficient kernel over \mathbb{R}^p, retaining its power of \sigma^2, and derive the marginal inverse-Gamma shape (n-p)/2. Explain exactly why adding p/2 gives the wrong answer.

This exercise has no worked answer.