A sphere of radius R has uniform volume charge density. The electric potential at a point situated at a distance r (r < R) is :
By Gauss's law the electric field at a distance r is E.4πr2=Qenϵ0
or E=Qen4πϵ0r2 where Qen= charge inside sphere of radius r.
As the potential V=−∫Edr so the electric potential at r due to charge inside a sphere of radius r only.