expected value of non-negative random variable If $X$ is a random variable  and $X\geq 0$ then $E[X] =\int_{\mathbb {R}}xf(x)dx\geq 0$. Does it mean that we can rewrite $E[X] = \int^\infty_{0}xf(x)dx\geq 0$?
 A: Yes, for $X \geq 0$ the pdf $f$ has the property $f(x)=0$ almost everywhere on $(-\infty,0)$ so it is enough to integrate over the positive real  line.  
A: Yes. Think of it like this:
We are given $X: \Omega \to \mathbb R$ to be a random variable. Let $A \subseteq \Omega$, $A := \{\omega \in \Omega | X(w) \ge 0\} = \{X \ge 0\}$. Take for granted $A$ is an event and that the map $1_{A}: \Omega \to \mathbb R$, where $1_A(\omega) = 1$ if $\omega \in A$ and $=0$ if $\omega \notin A$, called the indicator function on $A$, is a random variable.
Then


*

*For each $\omega \in \Omega$, $X(\omega)1_{A}(\omega)=X(\omega)$ if and only if $X(\omega) \ge 0$ if and only if $1_A(\omega) = 1$

*$E[X] =\int_{\mathbb {R}}xf(x)dx$

*by law of the unconscious statistician (Choose $g: \mathbb R \to \mathbb R$, $g(x)=x1_{x \ge 0}$, such that $g(X)=X1_A$), $E[X1_{A}] = \int_{\mathbb {R}}x1_{x \ge 0}(x)f(x)dx$

*$\int_{\mathbb R}x1_{x \ge 0}(x)f(x)dx = \int_{x \ge 0}xf(x)dx$ because $\int_{(-\infty,0)}x1_{x \ge 0}(x)f(x)dx = 0$ because $1_{x \ge 0}(x) = 0$ for all $x \in (-\infty,0)$.
Since we're given that $X \ge 0$, i.e. $A = \Omega$, we have by all the above that
$$\int_{\mathbb {R}}x1_{[0,\infty)}(x)f(x)dx = E[X]=E[X1_{A}] = \int_{[0,\infty)}xf(x)dx$$

Note: For any advanced people out there, I've omitted any notion of probability space $(\Omega,\mathcal F, \mathbb P)$. Hope this is ok for elementary probability where every random variable has a probability distribution function.
