We consider the shaded elemental ring of mass
`dm=M/((2piR^(2)))2piRsintheta(Rd theta)`
Field due to this ring at `O`
`dE=(GdmRcostheta)/(R^(3))`
(see formulae for field due to a ring)
or `dE=(GM)/(R^(2)) sinthetacosthetad theta`
Hence `E=int_(0)^(pi//2) dE=int_(R^(2))^(pi//2) (GM)/(R^(2))sinthetacosthetad theta`
or `E=(GM)/(2R^(2))`