This solution to problem 6 will NOT be given on your formula sheet

$\rho ({\tilde {r}})=a{\tilde {r}}^{n}$ describes charge density as a function of distance to the origin. Since the Gaussian sphere is fixed at radius $r$ we use a tilde to denote the variable of integration used to calculate the charge enclosed by the Gaussian sphere.

If the field point $r<R$, the radius of the nonuniformly (but symmetrically charged sphere), then Gauss' law is: