Im interested with a derivation as shown by by Zoubin Ghahramani in his article ' **Learning Dynamic Bayesian Network**'

The whole objective was to prove

**P(Z, W|X,Y) = P(W|Y)P(Z|X,Y)** ---- EQ 1

Given a factorization

P(W, X, Y, Z) = P(W) P(X) P(Y|W) P(Z| X,Y),------- EQ 2

**The question was to show, from the above factorization, show that given the value of X and Y, Z and W are independent.**

In the manuscript, Ghahramani give the following to prove EQ 1. 
Such that,

$$P(Z,W | X,Y) = \frac{P(W,X,Y,Z)} {P(X, Y)} ..........(A)$$ 

$$ = \frac{P(W) P(X) P(Y|W) P(Z| X,Y)} {\int{P(W) P(X) P(Y|W) P(Z| X,Y)dW dZ}}..........(B)$$

$$ = \frac{P(W) P(Y|W) P(Z| X,Y)} {P(Y)}..........(C)$$

$$=P(W|Y) P(Z|X,Y) ..........(D)$$

%%%%%%%%%%%%%%%

I know that for the following, 
$${\int{P(W) P(X) P(Y|W) P(Z| X,Y)dW dZ}}$$

we arrange it such that

$$P(X) P(Y|W){\int{P(W) dW} { \int P(Z| X,Y) dZ}}$$

Where 
$${\int P(W) dW} =1$$
and

$$P(W|Y)=\frac{P(W,Y)} {P(Y)} $$

However, I am not so clear on,

* Why we need to integrate by the dW and dZ,
* How to get from P(X) P(Y|W) to P(Y) in equation C.

I really appreciate, if anyone can show how we get the solution from C to D.

Thanks in advance.

Best regard,
Rod