Calculating $f(x), f(x\mid y), f(y\mid x)$ from $f(x,y)\propto \left(\begin{array}n n\\ x\end{array}\right)y^{x+\alpha-1}(1-y)^{n-x+\beta-1}$ I'm reading about Gibbs sampling from a paper by Casella and George and in an example I'm given the following joint distribution for random variables $X$ and $Y$: 
$$f(x,y)\propto \left(\begin{array}n n\\ x\end{array}\right)y^{x+\alpha-1}(1-y)^{n-x+\beta-1}$$
where $x=0,1,\dots,n,\;\;0\leq y\leq 1$. I'm also given in my reference that 
$$f(x)=\left(\begin{array}n n\\ x\end{array}\right)\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\frac{\Gamma(x+\alpha)\Gamma(n-x+\beta)}{\Gamma(\alpha+\beta+n)}$$
$x=0,1,\dots,n$ and that by supressing the overall dependence on $n,\alpha$ and $\beta$ we get that 


*

*$f(x\mid y)$ is Binomial $(n,y)$ and 

*$f(y\mid x)$ is Beta $(x+\alpha, n-x+\beta)$.


How do we arrive in these solutions, i.e. how to calculate $f(x), f(x\mid y)$ and  $f(y\mid x)$?
 A: Any $f(x,y)$ can be written in the form $$f_{X,Y}(x,y)=Ku(x)w(y)φ(x,y)\tag{1}$$ where $K$ is a constant (with respect to $x,y$) and $u,w,φ$ are any functions. Now observe that $$f_{Y\mid X}(y\mid X=x)=\frac{f_{X,Y}(x,y)}{f_X(x)}=\frac{Ku(x)w(y)φ(x,y)}{Ku(x)\int_{\Bbb R}w(y)φ(x,y)\; dy}=cw(y)φ(x,y)$$ where $c$ is a new constant (with respect only to $y$ though!). Hence $$f_{Y\mid X}(y\mid X=x)\propto w(y)φ(x,y)$$ which means that you can "recognize the distribution of $Y\mid X=x$ by inspection of $w(y)$ and $φ(x,y)$". Similarly for $f_{X\mid Y}$. To see this in practice, write $f_{X,Y}(x,y)$ in the form of $(1)$:
$$f_{X,Y}(x,y)\propto \underbrace{\dbinom{n}{x}}_{=u(x)}\underbrace{y^{α+1}(1-y)^{β-1}}_{=w(y)}\underbrace{y^x(1-y)^{n-x}}_{=φ(x,y)}$$ Based on the above \begin{align}f_{Y\mid X}(y\mid X=x)&\propto w(y)φ(x,y)\propto y^{x+α-1}(1-y)^{n-x+β-1}\tag{2}\\[0.2cm]f_{X\mid Y}(x\mid Y=y)&\propto u(x)φ(x,y)\propto \dbinom{n}{x}y^{x}(1-y)^{n-x}\tag{3}\end{align} Now from $(3)$ it must be immediate that $X\mid Y=y \sim {\rm Bin}(n,y)$ and from $(2)$ (perhaps with some more experience with Beta distribution) that $Y\mid X=y \sim {\rm Beta}(x+a,n-x+β)$. Having all these, calculate $f_X(x)$ as $$f_X(x)=\frac{f_{X,Y}(x,y)}{f_{Y\mid X}(y\mid X=x)}$$
A: To find the density of $f(x)$ (marginal density) you can use
$$f_{\mbox{temp}}(x) = \int_{0}^{1} \binom{n}{x}y^{x+\alpha-1} (1-y)^{n-x+\beta-1}dy. \quad (*)$$
To solve the above integral, you can make use of the beta-function $$\beta(x,y) = \int_{0}^{1} t^{x-1}(1-t)^{y-1}dt.$$
Note that since you do not have an exact form for the joint density (because of the $\propto$) you'll have to find a constant $c$ such that 
$\sum_{x=0}^{n} c f_{\mbox{temp}}(x) = 1$. Hence, $f(x) = c f_{\mbox{temp}}(x)$. Consequently, by applying the formula
$$f_{Y \ | \ X}(y \ | \ X = x) = \frac{f_{X,Y}(x,y)}{f_X(x)},$$
you can find the conditional distribution of $Y$. 
