# Signle variable integration with respect to a function

I guess this is a trivial problem. I was reading about expected value on wiki and I came across a notation of an integral I don't understand. There is a statement that a general case of expected value has this form:

$$E[X]=\int_{\Omega} X(\omega)\,dP(\omega)$$

with a comment that this is a Lebesgue integral. I was taught to calculate integrals or multi integrals with respect to a number of variables, not functions. When I see the term $$dP(\omega)$$, I am confused! I know an expected value can also be expressed in this form

$$E[X] = \int_{X} x\,p(x)\,dx$$

because it is simply a weighted sum / integral of a random variable over probabilities associated with its realizations.

How to understand an integral when it is calculate with respect to a function?

That integral "$$dP(\omega)$$" is simply the integral with respect to that measure.
In practice, how will we evaluate it? We'll find a density function $$\rho$$, or a probability mass function $$p$$, and convert it to something like $$E(X) = \int_{\Omega} x\rho(x)\,dx$$ in the density case (where $$\Omega$$ is the space of possible values), or $$E(X) = \sum_{x\in \Omega}xp(x)$$ Writing it in terms of the probability measure $$P(\omega)$$ allows us to unify those two expressions, as well as more complicated cases (that hardly ever come up in practice).
• I am afraid don't know what a measure or a measure of set is but when I read your explanation I kind of understand that $P(\omega)$ is one of the measures we could use. In this example, it is Probability but it could be something esle. When we integrate with respect to $dP(\omega)$, we take numbers a function returns (probability) and not what variables are. Could integration be considered as a operand over product of terms and this time the "term" is not a variable but a value of a function? I am confused :p but thanks for the answer. Commented Mar 12, 2019 at 12:04