Suppose $\{X_1,X_2,Z\}$ is a vector of 3 real valued continuous random variables with compact support, $f_1(X_1,X_2)$, $f_2(X_1,X_2)$, and $g(X_1,X_2)$ are measurable functions with at least 2 continuous partial derivatives all of which are integrable. Are the following equations valid ways of manipulating each equation? If not why not and if you have a pertinent reference I would appreciate it.
$1.) \;\;E\bigr[\; f_1(X_1, X_2) \; E[g(X_1,X_2) Z \; |X_1 ] \; \big|X_1 \bigr] = E\big[ E[f_1(X_1,X_2)g(X_1,X_2)Z|X_1] \big|X_1 \big] $
$2.) \;\;E\bigr[\; f_1(X_1, X_2)f_2(X_1,X_2) \; E[g(X_1,X_2) Z \; |X_1 ] \; \big|X_1 \bigr] = E\big[f_2(X_1,X_2) E[f_1(X_1,X_2)g(X_1,X_2)Z|X_1] \big|X_1 \big] $
Your help will be much appreciated.