Example - a uniform rod of length L rotating about one end

How do we evaluate the moment of inertia integral:
I = r2 dm

for a uniform rod of length L rotating about an axis passing through one end of the rod, perpendicular to the rod?

Align the rod with the x axis so it extends from 0 to L. Split the rod into little pieces of size dx. The mass of each little piece is:

dm = λ dx, where λ is the mass per unit length of the rod.
λ =
M
L
, where M is the rod's total mass.

The integral becomes:
I   =
L
    x2 λ dx
0
I =
λ x3
3
|
L 
 
0 
=
λ L3
3

Substituting M = λL gives:
I =
1
3
ML2     for a uniform rod rotating about one end.

We could carry out such integrals for all sorts of different shapes, although many of them are integrals over areas or volumes instead of over lengths. It's easier to look up the result in the table on page 227 in the book.