Can we express $ \operatorname{E}[(Y\mid X=x)^2]$ in the integral form? (Suppose $Y$ and $X$ are continuous random variables) I'm studying conditional variance, and I think 
$$\operatorname{Var}(Y\mid X=x)=E[(Y\mid X=x)^2]-[E(Y\mid X=x)]^2$$
I wonder if we can express $E[(Y\mid X=x)^2]$ in the integral form. 
I only know something like
$$E(g(Y))=\int g(y)f_Y(y)\, dy $$ and  $$E(g(Y)\mid X=x)=\int g(y)f_{Y\mid X=x}(y) \, dy. $$ 
 A: You wrote
$$
\operatorname{var}(Y\mid X=x)=\operatorname{E}[(Y\mid X=x)^2]-[\operatorname{E}(Y\mid X=x)]^2
$$
That is incorrect; what you need is
$$
\operatorname{var}(Y\mid X=x)=\operatorname{E}(Y^2 \mid X=x)-[\operatorname{E}(Y\mid X=x)]^2.
$$
Here I'm going to guess that you imagine $(Y\mid X=x)^2$ to be something whose expected value you seek. But in fact you need the expected value given the event $X=x,$ of the random variable $Y^2.$ The operator $\operatorname{E}( \cdot \mid X=x)$ is applied to the random variable $Y^2.$
This is like what you do with conditional probabilities: $\Pr(A\mid B)$ is not the probability of something that is called $\text{“}A\mid B\text{ ''}$; rather, it is the probability given $B,$ of the event $A.$
If $y\mapsto f_{Y\,\mid\,X\,=\,x} (y)$ is the conditional probability density function given the event $X=x,$ of the random variable $Y,$ then you have
$$
\operatorname{E}(Y^2 \mid X=x) = \int y^2 f_{Y\,\mid\,X\,=\,x} (y) \, dy
$$
and
$$
\operatorname{E}(Y \mid X=x) = \int y f_{Y\,\mid\,X\,=\,x} (y) \, dy
$$
and
$$
\operatorname{var}(Y\mid X=x) = \operatorname{E}(Y^2 \mid X=x) - (\operatorname{E}(Y\mid X))^2.
$$
