Charge within radius r is
q=∫r0ρ0[1−rR]4πr2dr
=4πρ0∫r0(r2−r3R)dr
=4πρ0(r33−r44R) (i)
For r < R,
E=kqr2=ρ0r3ε0[1−3r4R] (ii)
For total charge, put r=R in Eq. (i)
Q=4πρ0[R33−R34]=4πρ0R312
For r > R,
E=kQr2=ρ0R312ε0r2 (iii)
At surface, from both Eqs. (ii) and (iii), put r=R.
E0=ρ0R12ε0
For maximum, dE/dr=0 from eq. (ii).
r=23R
E=ρ0R9ε0
Also, at r=R/3,
E=ρ0R12ε0