Let $X_2$ and $X_3$ be two non-negative independent exponentially distributed random variables with a parameter $\lambda$.
Assume I have the following cost function:
$$W(X_2) = \begin{cases} X_2+X_3 , \space \space \space \space X_2 < 10 \space AND \space X_3<10,\\ 0, \space \space \space \space \space \space \space \space \space \space\space \space\space\space\space otherwise \end{cases} $$
Now I want to calculate the expectation of $W$. However, I'm confused if I need to use double integration like this:
$$E[W] = \int\int (x_2+x_3)\lambda^2 e^{-\lambda x_2} e^{-\lambda x_3}dx_2dx_3,$$
Where the limits of this double integral from $0$ to $10$. Or just saying:
$$E[W] = E[X_2]+E[X_3]$$ where $$ E[X_i] = \int x_i \lambda e^{-\lambda x_i } dx_i$$
and the integration from $0$ to $10$
Since $$ W=(X_2+X_3)\mathbb 1_{\{X_2<10\}}\mathbb 1_{\{X_3<10\}} = X_2 \mathbb 1_{\{X_2<10\}}\mathbb 1_{\{X_3<10\}} + X_3\mathbb 1_{\{X_2<10\}}\mathbb 1_{\{X_3<10\}} $$ and $X_2,X_3$ are independent, you can split it into $$ \mathbb E[W] = \mathbb E[X_2; X_2<10]\mathbb P(X_3<10)+\mathbb E[X_3; X_3<10]\mathbb P(X_2<10) $$ $$ =2\left(1-e^{-10\lambda}\right)\int_0^{10} x \lambda e^{-\lambda x } dx $$ Note that $$ \mathbb E[W] \neq \mathbb E[X_2; X_2<10]+\mathbb E[X_3; X_3<10]. $$ Double integral give the right answer too.