@studiot, if we used the constants [math]\rho\left(R\right)[/math] and [math] g\left(R\right) [/math] then it would be true that [math] \int_{0}^{R} \rho\left(R\right)g\left(R\right)dr = \rho\left(R\right)g\left(R\right)R = P_{R} [/math].
However, this is not the case. When [math] \rho = \rho\left(r\right) [/math] and [math] g = g\left(r\right) [/math] then in general, [math] \int_{0}^{R} \rho\left(r\right)g\left(r\right)dr \neq \rho\left(R\right)g\left(R\right)R [/math]. Note also that [math] \int \rho\left(r\right)g\left(r\right)dr \neq \rho\left(r\right)g\left(r\right)r [/math]. If you still disagree with the math, then please show your own working out.
@joigus, I was not trying to represent any particular formulas in my graph. I was just trying to point out graphically that two different functions will not have the same value of definite integral over the interval [math]r = 0[/math] to [math]r = R[/math] just because their endpoints have the same value.