Answer:

Explanation:
1) Notation and info given
 represent the density at the center of the planet
 represent the density at the center of the planet
 represent the densisty at the surface of the planet
 represent the densisty at the surface of the planet
r represent the radius
 represent the radius of the Earth
 represent the radius of the Earth
2) Solution to the problem
So we can use a model to describe the density as function of  the radius


So we can create a linear model in the for y=b+mx, where the intercept b= and the slope would be given by
 and the slope would be given by 
So then our linear model would be 

Since the goal for the problem is find the gravitational acceleration we need to begin finding the total mass of the planet, and for this we can use a finite element and spherical coordinates. The volume for the differential element would be  .
.
And the total mass would be given by the following integral

Replacing dV we have the following result:

We can solve the integrals one by one and the final result would be the following

Simplyfind this last expression we have:


![M=\pi r^3_{earth}[\rho_{surface}+\frac{1}{3}\rho_{center}]](https://tex.z-dn.net/?f=M%3D%5Cpi%20r%5E3_%7Bearth%7D%5B%5Crho_%7Bsurface%7D%2B%5Cfrac%7B1%7D%7B3%7D%5Crho_%7Bcenter%7D%5D)
And replacing the values we got:

And now that for any shape the gravitational acceleration is given by:
