Yes, exactly. See also [Expectation of function,vs,function of expectations) and [Expected value of a power)