I would like to learn how to solve integrals with indicator functions of the type
$$ E[X \cdot I_{ \{X\ge2 \}}] = \int_0^4 \frac{1}{4} [X \cdot I_{ \{X\ge2 \}}] dX $$
where $E$ the expectation function and $X$ a uniform random variable with $X \sim U(0,4)$.
From a paper I derive the solution as 1.5. What is the correct way of arriving at this result, and to address integrals like these involving the indicator function. Thank you.
$$ E[X \cdot I_{ \{X\ge \eta \}}] = \frac{1}{4} \int_{2}^{4} X dX = \frac{1}{8} (4^2 - 2^2) = \frac{12}{8} = 1.5. $$
We can do this with the limits of integration since the random variable $X$ is $0$ when it is less than $2$, which is shown in the indicator function.