Doing the posterior distribution
$$\pi(\theta,\sigma^2\mid x_1,\ldots,x_n)\propto \frac{1}{\sigma^2}(2\pi\sigma^2)^{-n/2}e^{-1/(2\sigma^2)\Large{\sum(x_i-\theta)^2}}$$
$$\propto (\sigma^2)^{-1}(\sigma^2)^{-\dfrac{n}{2}}e^{-\dfrac{1}{2\sigma^2}\Large{\sum(x_i-\theta)^2}}$$
doing the algebra, we have
$\propto e^{-\dfrac{n}{2\sigma^2}\Large{(\theta-\bar{x})^2}}(\sigma^2)^{-(\dfrac{n}{2}+1)}e^{-\left(\dfrac{1}{2}(\Large{\sum(x_i-\bar{x})^2)}\right)\dfrac{1}{\sigma^2}}$
it's easy to see that
$\pi_i(\theta|\sigma^2,x)\sim N(\bar{x},\dfrac{\sigma^2}{n}) $
but the problem is that it gives me in the second distribution
$\pi_2(\sigma^2|x)\sim inv Gamma(\dfrac{n}{2},(\dfrac{1}{2}\Large{\sum(x_i-\bar{x})^2)^{-1}}) $
and the answer says that it should give me in the first parameter $\dfrac{n-1}{2}$
What am I doing wrong? If in the end it is only to operate two exponentials
$(\sigma^2)^{-1}(\sigma^2)^{-\dfrac{n}{2}}=(\sigma^2)^{-(\dfrac{n}{2}+1)}$
and in the inverse gamma distribution it can be seen that the variable x is raised to the first parameter with the form
$x^{-(\alpha+1)}$ which in this case $\alpha$ should be $\dfrac{n}{2}$ then where does it come from $\dfrac{n-1}{2}$, the book is not incorrect because there are several problems that present the same situation, PLEASE HELP!!!!
