Here's the situation
$X \sim N(\mu, \sigma^2)$ and given $X=x$, $Y \sim N(x, \tau^2)$
I need to find the distribution of $X$ given $Y=y$
From what's given, I know the pdf's of $X$ as well as $Y|X=x$. By multiplying those pdf's together, I can find the joint distribution of $X$ and $Y$ ($f_{X,Y}=f_Xf_{Y|X=x}$).
This seems useful, but I have no clue how to go about finding $f_Y$ to finish it off (since $f_{X|Y=y} = f_{X,Y}/f_Y$). The integral from $-\infty$ to $y$ of $f_{X,Y}$ with respect to $X$ doesn't have a closed form solution to my knowledge.
Is this possible? Am I on the right track? Any help would be tremendously appreciated!
We have $$f_X(x) = \frac{1}{\sqrt{2\pi} \sigma} e^{-(x-\mu)^2/(2\sigma^2)},$$ and $$f_{Y\mid X}(y) = \frac{1}{\sqrt{2\pi}\tau} e^{-(y-x)^2/(2\tau^2)}.$$ Therefore the joint density is proportional to $$f_{X,Y}(x,y) \propto \exp\left(-\frac{(x-\mu)^2}{2\sigma^2} - \frac{(y-x)^2}{2\tau^2}\right).$$ If we collect like terms in $x$, we find $$\begin{align*} (x-\mu)^2 \tau^2 + (y-x)^2 \sigma^2 &= (\sigma^2 + \tau^2)x^2 - 2(\sigma^2 y + \tau^2 \mu)x + (\sigma^2 y^2 + \tau^2 \mu^2) \\ &= (\sigma^2 + \tau^2) \left( x^2 - 2 \frac{\sigma^2 y + \tau^2 \mu}{\sigma^2 + \tau^2} x + \frac{(\sigma y)^2 + (\tau \mu)^2}{\sigma^2 + \tau^2}\right) \\ &= (\sigma^2 + \tau^2) (x^2 - 2Bx + C) \\ &= (\sigma^2 + \tau^2)\left((x - B)^2 + C - B^2\right) . \end{align*}$$ So $$f_{X,Y}(x,y) \propto \exp\left(-\frac{(x-B)^2}{2(\sigma \tau)^2/(\sigma^2 + \tau^2)} \right) \exp\left(- \frac{B^2 - C}{2(\sigma\tau)^2/(\sigma^2 + \tau^2)}\right).$$ The first exponential factor contains $x$, but the second does not. Consequently, $$f_{X \mid Y}(x) = \frac{f_{X,Y}(x,y)}{f_Y(y)} \propto f_{X,Y}(x,y) \propto \exp\left(-\frac{(x-B)^2}{2(\sigma \tau)^2/(\sigma^2 + \tau^2)} \right).$$ This is because the second exponential factor, being entirely independent of $x$, is merely a constant of proportionality, as is the marginal distribution $f_Y(y)$. The only component that we need to preserve are those factors that contain the variable of interest, $x$. Since the remaining expression is proportional to a normal density with mean $B = (\sigma^2 y + \tau^2 \mu)/(\sigma^2 + \tau^2)$ and variance $(\sigma\tau)^2/(\sigma^2 + \tau^2)$, the conditional distribution of $X$ given $Y = y$ is normal with the aforementioned mean and variance. Note that we don't need to do any integration.