Let P(r)=QπR4r be the charge density distribution for a solid sphere of radius R and total charge Q. For a point p1 inside the sphere at distance r1 from the centre of sphere, the magnitude of electric field is
Consider a differential thickness dr at a radius r.
We get the area for this differential thickness as dA=4πr2dr
Thus we get the electric field at this point as dE=kdQr21
or
dE=14πϵoQr4πr2drπR4r21
E=Q4πϵ0r21πR4∫r1r=04πr3dr
=Qr214πϵ0R4