668. Determine the mass of a sphere of radius $r$, if the density at each of its points is proportional to the distance from the center of the sphere.
Solution. Let the mass of a sphere of arbitrary radius $x$ be some function $m(x)$.

When $x$ is increased by a small amount $d x$, the volume $v$ of this sphere increases by an amount $\Delta v$, equal to the difference in volumes of spheres with radii $x$ and $x+d x$:

$$
\begin{gathered}
\Delta v=\frac{4}{3} \pi\left[(x+d x)^{3}-x^{3}\right]= \\
=\frac{4}{3} \pi\left(3 x^{2} d x+3 x d x^{2}+d x^{3}\right) \approx 4 \pi x^{2} d x=d v
\end{gathered}
$$

Assuming that the density remains constant and equal to $k x$ at all points within the small volume $d v$, we find the approximate value of its mass $d m=k x d v=4 k \pi x^{3} d x$.

The desired mass $M$ of a sphere of radius $r$ is obtained by integrating $d \boldsymbol{m}$ from $x=0$ to $x=r$:

$$
M=4 k \pi \int_{0}^{r} x^{3} d x=\left.k \pi x^{4}\right|_{0} ^{r}=k \pi r^{4}
$$