I have that $Y_i$ has distribution $N(\beta x_i^2, 1)$, $i=1 \dotsc n$ where $\beta$ has a prior distribution $N(0, \sigma^2)$. I need to calculate the posterior density of $\beta$, find its mean and variance.
My approach was to say that $p(\beta, y) \propto f(y|\beta)p(\beta) \propto \exp \left\{ -\frac{(y_i - \beta x_i^2)^2}{2}\right\} \exp \left\{ -\frac{\beta^2}{2\sigma^2}\right\}$.
To make the maths less messy, I omit the summation notation (but I do not forget about it!). I get that:
$p(\beta|y) \propto \exp \left\{ - \frac{1}{2} (\beta^2 (x_i^4 - \sigma^{-2}) - 2\beta (x_i^2 y_i) + y_i^2)\right\}$
Now, if I understand the question correctly I should be able to get a normal distribution-like expression inside the brackets. However, I fail to see how to make that happen.
The hint is that the variance of posterior density of $\beta$ is supposed to be $(x_i^4 - \sigma^{-2})^{-1}$ which tells me I should be quite close to getting the right answer.