Lebesgue integration of simple functions Define $f : [0,1] \to \Bbb R$ by $f(x) := 0$ if $x$ is rational, and
  $f(x) := d^2$ if $x$ is irrational, where $d$ is the first nonzero
  digit in the decimal expansion of $x$. Show that $\int_{[0,1]} f d m
  = 95/3$. Here $m$ is the Lebesgue measure
I know that $f$ is simple, but can someone please suggest on how to proceed with this?
 A: If you want, you can think about this integral geometrically.  The function you described is equal almost everywhere to the following step function (or should I say, function of infinite repeating narrower staircases; intervals are not drawn to scale):

As you can see in the picture, what we get for the total area under that step function of infinite repeating steps is:
$\sum \limits_{n = 1}^{\infty} (81 + 64 + 49 + 36 + 25 + 16 + 9 + 4 + 1) \cdot (.1)^{n}$
$= \sum \limits_{n = 1}^{\infty} 285 \cdot (.1)^{n}$
Since $.1 < 1$, we know this series converges, and it converges to:
$\dfrac{\text{first term}}{1 - \text{common ratio }r} = \dfrac{285 \cdot .1}{1 - .1} = \dfrac{28.5}{.9} = \dfrac{95}{3}$, and thus the total area is $\dfrac{95}{3}$.
Note that I used the fact that if two functions are equal almost everywhere, their integrals are equal.
A: Consider $S_d$ to be the set of all irrational $x$ numbers of the form $0.0\ldots 0dp_1p_2\ldots$ as their first non-zero digit. Then we can partition $S_d = S_d^1 \cup S_d^2\cup S_d^3\cup ...$ where the upper index indicates at which decimal point the first digit occurs. It is clear that $m(S_d^1) = 0.1$ (it is comprised of the irrationls in the interval $[0.d,0.d+1)$ by much the same argument $m(S_d^2) = 0.01$ and so on, so since they are all disjoint and partition the irrationals in the unit interval $m(S_d) = 0.1111.... = 1/9$.
Finally, since $f$ is constant equal to $d^2$ in $S_d$, the integral becomes:
$$\int_I f\ dm = \sum_{d=1}^9 (\int_{S_d} f\ dm) = \sum_{d=1}^9 {d^2 \over 9} = {95\over 3}$$
(the previous argument to show that all the $S_d$ had the same measure was wrong, sorry for that)
