Calculating the Lebesgue Integral given only the measure of a set Let $f\geq 0$. Let
$$
\mu\left(\{x: f(x) > t\}\right) = \frac{1}{t^2 + 1}
$$
I'm trying to compute
$$
\int_\mathbb{R} f\,\,d\mu
$$
To compute this, this is the approach I took. I know that the integral of a measurable function is
$$
\int f\,\,d\mu = \sup\left\{\int g\,d\mu : g\text{ simple}, 0\leq g\leq f \right\}
$$
Further, I know that I can represent $f$ as a non-decreasing sequence of simple functions that converges to $f$, as such:
$$
f_n = n\cdot1_{B_n} + \sum_{k=1}^{n\cdot2^n}\frac{(k-1)}{2^n}1_{A_n,k}
$$
where
$$
B_n = \{x: f(x) > n\}
$$
and
$$
A_{n,k} = \{x: (k-1)2^{-n} < f(x) \leq k\,2^{-n}\}
$$
Now, since this sequence is increasing and converges to $f$, the sup of the set earlier would just be
$$
\lim_{n\to\infty}\int f_n
$$
But, I'm unsure how exactly to calculate this. I know that if $g$ is a simple function such that
$$
g = \sum^n_{k=1}c_k
$$
Then
$$
\int g = \sum_{k=1}^n c_k\mu(A_k)
$$
But, our sequence of $f_n$ has the $n\cdot1_{B_n}$ as an additional term outside the summation, and for the measure of $A_{n,k}$, I'm unsure if I'm allowed to say that
\begin{align}
\mu\left(\{x: (k-1)2^{-n} < f(x) \leq k\,2^{-n}\}\right) &=\\ &=\mu(\{x: f(x) > (k-1)2^{-n}\}) - \mu(\{x: f(x) > k\cdot2^{-n}\})
\end{align}
 A: On any measure space $(X, \mathcal{F}, \mu)$, if $f \colon X \to [0, \infty]$ is measurable, then
$$\int_{X}f\,d\mu = \int_{0}^{\infty}\mu(\{x \in X : f(x) > t\})\,dt.$$
When $\mu$ is $\sigma$-finite, this is an easy consequence of Tonelli's theorem. If $\mu$ is not $\sigma$-finite, then to prove it you can first prove it when $f$ is a simple function and then use monotone convergence theorem.
A: Let $\mu_f(A) = \mu \{ x \mid f(x) \in A \}$, we are given
$\mu_f([0,t]) = 1-{1 \over 1+t^2}$.
A fairly standard result (using $f \ge 0$) is the change of variables formula
$\int f d \mu = \int_0^\infty t d \mu_f(t)$ which evaluates to $\pi \over 2$.
The other formulas appearing in answers & comments are consequences of this.
In particular, $f$ is integrable.
To evaluate directly using simple functions you can proceed using simple functions as you have above. You canchoose the simple functions in any manner as long as they are dominated by $f$ and converge pointwise to $f$.
I will choose simple functions that allow me to determine the limit using
Riemann integration. This is essentially the change of variables formula in disguise.
Let $p(t) = \mu_f([0,t]) = 1-{1 \over 1+t^2}$, where $t \in [0,\infty)$ and the range of $p$ is $[0,1)$. It is straightforward to compute an inverse
$\xi(y) = \sqrt{{1 \over 1-y} -1}$. Note that $\xi(0) = 0$ and $\lim_{y \uparrow 1} \xi(y) = \infty$.
Pick $n$ and (suppressing the $n$ in the definitions of $t_k, A_k$) let $t_k = \xi({ k \over n}) $ for $k=0,...,n-1$. Define the simple function $s_n(x) = \sum_{k=0}^{n-1} \xi({ k \over n}) 1_{A_k}(x)$,
where $A_k = \{ x \mid t_k < f(x) \le t_{k+1} \}$. Note that by construction,
we have $\mu(A_k) = {k+1 \over n}-{k \over n}$.
It is straightforward to check that $s_n \le f$ and $s_n(x) \to f(x)$, hence
$\int f d \mu = \lim_n \int s_n d \mu = \lim_n \sum_{k=0}^{n-1} \xi({ k \over n}) ({k+1 \over n}-{k \over n})$.
Now note that $\int f d \mu = \lim_n \int \sigma_n(x) d x $, where $\sigma_n(x) = \sum_{k=0}^{n-1} \xi({ k \over n}) 1_{[{k \over n},{k+1 \over n})}(x) $ is a simple function that converges to $\xi$, that is $\sigma_n \le \xi$ and $\sigma_n(x) \to \xi(x)$.
Hence $\int f d \mu = \int_0^1 \xi(x)dx = \int_0^1\sqrt{{1 \over 1-x} -1}dx$
and using (improper) Riemann integration we get $\int f d \mu = { \pi \over 2}$.
