I'm having hard times in understanding what does it really mean when they say "integration with respect to a measure$. I mean a writing like
$$\int f\ \text{d}\mu$$
These are my doubts:
- What is $f$? I mean is it $f(x)$ or what?
- If $\mu$ has a density $h(x)$, then it becomes $\int f\circ h(x) \ \text{d}\mu(x)$ ?
- Can someone really provide a true concrete example of this? I mean if $f = x^2$ then what does $$\int x^2\ \text{d}\mu$$ mean?
Or if $\mu$ has density like $h(x) = \frac{1}{2x}e^{-x^2}$ or whatever...
I cannot find any good book or notes with examples. Why is it so hard to provide examples?
I assume that you know what a Lebesgue integral with respect to the Lebesgue measure is and understand it well enough. Notice that (from the definition) $\int f(x) dx := \int f \ d \mathcal{L}^n$ on $\mathbb{R}^n$ where $\mathcal{L}^n$ is the $n$ dimensional Lebesgue measure. This is what is meant by $dx$ in the context of Lebesgue integrals; it's not a Riemann integral (although often, for many functions $f$ they are indeed equal).
Now in a very special case of a nonegative measure $\mu$ on $\mathbb{R}^n$ with a density with respect to the $n$-dminesional Lebesgue measure (that is $\mu(A) = \int_A h(x) \ dx$ for some nonegative function $h$ called a "density" and all Borel sets $A \subset \mathbb{R}^n$) we do have the formula $$\int g \ d\mu = \int g(x)h(x) \ dx $$ for every Borel-measurable function $g$.
This formula follows (nontrivially) from the definition of Lebesgue integral with respect to $\mu$. The proof probably won't answer your question though, but here it goes anyway. Skip it if you want to.
You can prove it by proving it gradually: for all characteristic functions $g$, then for all simple functions $g$ (by linearity of the integral), then for all nonegitive functions $g$ (the monotone convergence theorem) and then for any $g$ (decompose $g$ into $g^+$ and $g^-$). Use the definition of an integral of a simple function if you get lost in the first or second step. That's the proof of the formula.
The problem is we don't want to restrict ourself just to measurable spaces $(\mathbb{R}^n, \mathcal{B}(\mathbb{R}^n), \mu)$, where $\mu$ has a density with respect to the Lebesgue measure. We want to be able to integrate on any measurable space $(X, \sigma, \nu)$.
So we need to define what we would like $\int f \ d\nu$ to mean.
Now to help you build an intuition: Read the definition of the Lebesgue integral with respect to the Lebesgue measure. We want to geralize it. So instead of using the Lebesgue measure we want to use the measure $\nu$. Look at the definition of Lebesgue integral with respect to the measure $\nu$. Notice the similarities. Notice how we plug $\nu$ instead of $\mathcal{L}^n$ when we define the integral of a simple function. That's the simple idea that allows us to generalize the integral.
So in the end: the integral is kind of like "the area under the graph" but with a measure $\nu$ measuring the domain instead of the usual Lebesgue measure. It's more abstract, but gives you more freedom to apply the theory of integrals.
It's usaually not easy to compute explicitly unless we have the special case I wrote about in the first paragraph. And even then a Lebesgue integral with respect to the Lebesgue measure is usually not easy to compute explicitly either unless it's equal to the Riemann integral (then we can use the usual Fundamental Theorem of Calculus to compute the integral).