Expectation of a random variable over disjoint intervals I wanted to know if there is a formal way to show the following.
Say I have a random variable X that takes value over the interval [-1, 1].
Now I split the interval in 2 parts A = [-1, 0] and B = [0, 1]
Intuitively I think I can write the expected value of X as:
E[X] = E[X|X in A] + E[X|X in B] by summing the conditional expectation on the two disjoint sets.
I am struggling to get a formal proof.
Can anyone point me in the right direction?
Many thanks

Your idea is right but you need to "weight" each conditional expectation by the associated probability.
For a variable $X$ and an event $E$, the conditional expectation $\mathbb E(X\mid E)$ is defined as ($I$ is the indicator function),
$$
\mathbb E(X \mid E) = \frac{\mathbb E(XI_E)}{\mathbb P(E)}
$$
which gives
$$
\mathbb E(XI_E) = \mathbb E(X \mid E) \mathbb P(E)
$$
In your case since $B= A^c$ we can write the variable $X$ as
$$
X = XI_{X\in A} + XI_{X\in B}
$$
By linearity of the expectation we have
$$
\mathbb E(X) = \mathbb E(XI_{X\in A}) + \mathbb E (XI_{X\in B})
$$
where
$$
\mathbb E(X I_{X \in A}) = \mathbb E(X\mid X\in A)\mathbb P(X \in A)
$$
and
$$
\mathbb E(X I_{X \in B}) = \mathbb E(X\mid X\in B)\mathbb P(X \in B)
$$
Therefore the expectation of $X$ is
$$
\mathbb E(X) = \mathbb E(X\mid X\in A)\mathbb P(X \in A) + \mathbb E(X\mid X\in B)\mathbb P(X \in B)
$$
