Difficult# Mass of a Planet with Non-Constant Density

APPHMC-VYXHYI

A particular planet is spherically symmetric, but has a non-constant density given by $\rho \left( r \right) ={ \rho }_{ 0 }\left( 1-\frac { r }{ R } \right)$, where $R$ is the radius of the planet.

What is the total mass of the planet?