Conditional expectation of a function of two random variables given one of them

29 Views Asked by At

Given two random variables $X_1,X_2$ how does one prove $$E[g_1(X_1)g_2(X_2)|X_2] = E[g_1(X_1)|X_2]g_2(X_2) $$

I can see the intuition that since $X_2$ is given, the piece depending on it should come out of the expectation but I'm not being able to write it down mathematically. An answer involving pdfs and cdfs would be more appreciated than an answer from a measure theoretic point of view.