Four charges +q, -q, +q and- q are placed in order on the four consecutive corners of a square of side a.The work done in interchanging the positions of any two neighbouring charges of the opposite sign is :
For square , AB=BC=CD=AD=a and AC=BD=√a2+a2=√2a
Initial potential energy of the system is
Ui=k[−q2AB+−q2BC+−q2CD+−q2AD+q2AC+q2BD]
=k[−q2a+−q2a+−q2a+−q2a+q2√2a+q2√2a]
=kq2a[√2−4]
After interchanging the charges in between B and C ,the final potential energy is
Uf=k[q2AB+−q2BC+q2CD+−q2AD+−q2AC+−q2BD]
=k[q2a+−q2a+q2a+−q2a+−q2√2a+−q2√2a]
=kq2a(−√2)
Work done = change in potential energy=Uf−Ui=kq2a[(−√2)−√2+4]=q24πϵ0a[4−2√2]