The mass per unit length of a non-uniform rod of length $l$ is given by $\lambda=A \cos (\pi x / 2 l)$, where $x$ is position along the rod, $0 \leq x \leq l$.
(a) What is the mass $M$ of the rod?
(b) What is the coordinate $X$ of the center of mass?