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?

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)
