# How to calculate distribution of Y|X from distributions of X|Y and Y [duplicate]

I'm trying to solve the following homework problem:

Let $X$ given $Y=y$ have a normal distribution with mean $y$ and variance one, and let the marginal distribution of $Y$ be normal with mean $\mu_{Y}$ and variance $\sigma_{Y}^{2}$. What is the distribution of $Y$ given $X=x$?

I know that

Definition Given two continuous random variables $X$ and $Y$ with joint probability density function $f_{XY}(x,y)$, the conditional probability density function for $X$ given $Y=y$ is

$f_{X|Y}(x|y)=\dfrac{f_{XY}(x,y)}{f_{Y}(y)}$

My thoughts so far:

We want to calculate $f(y|x)=\dfrac{f(x,y)}{f(x)}$. So we need to work out $f(x,y)$ and $f(x)$.

But $f(x,y)=f(x|y)f(y)$, and we know $f(x|y)=\dfrac{1}{\sqrt{2\pi}}\exp{-\dfrac{(x-y)^2}{2}}$ and $f(y)=\dfrac{1}{\sigma_Y^2\sqrt{2\pi}}\exp{-\dfrac{(y-\mu_Y)^2}{2\sigma_Y^2}}$.

Moreover, $f(x)=\int_{-\infty}^{\infty}f(x,y)dy$.

So we have

$f(y|x)=\dfrac{\dfrac{1}{\sqrt{2\pi}}\exp{-\dfrac{(x-y)^2}{2}}\cdot\dfrac{1}{\sigma_Y^2\sqrt{2\pi}}\exp{-\dfrac{(y-\mu_Y)^2}{2\sigma_Y^2}}}{\int_{-\infty}^{\infty}[\dfrac{1}{\sqrt{2\pi}}\exp{-\dfrac{(x-y)^2}{2}}\cdot\dfrac{1}{\sigma_Y^2\sqrt{2\pi}}\exp{-\dfrac{(y-\mu_Y)^2}{2\sigma_Y^2}}]dy}$

Is this correct? If so, is there any way to simplify this expression?

Many thanks in advance for any pointers.