How do I calculate Var(x) if I know that $X | Y = y \sim N(y,1)$ and the PDF of Y is given by
$$ f_Y(y) = \begin{cases} 3y^2 \ \ \ \text{for} \ 0 < y < 1 \\ 0 \ \ \ \ \ \ \ \text{othwerwise} \end{cases} $$ I thought about using the law of total variance:
$$ Var(x) = E[Var(X|Y)] + Var(E[X|Y]) = E[1] + Var(Y) $$ Is this correct so far? And how do I calculate $E[1]$?
The approach looks find to me. As you observed:
$E[X|Y]=Y$ and $Var(X|Y)=1$
Using the low of total variance than you correctly deduced:
$Var(X)=E[1]+Var(Y)$
Clearly:
$E[1]=1$, because the expectation value of a constant is the constant itself.
$Var(Y)$ can be computated as $E[Y^2]-(E[Y])^2$, where:
$E[Y]=\int_0^1 3y^2y dy=3/4$
$E[Y^2]=\int_0^1 3y^2y^2 dy=3/5$