
The distance between q and Q is r=x2+(2d)2=x2+4d2.
The force between q and Q will be F=r2kqQ.
From the given figure we can see that only vertical components of the forces will add, and the horizontal components will get cancelled out. Therefore,
Fnet=r22kqQcosθ=r22kqQ×rx=(x2+4d2)23kqQx
For force to be maximum, dxdFnet=0.
⇒kqQ[((x2+4d2)23)2(x2+4d2)23−x×23(x2+4d2)21×2x]=0
⇒(x2+4d2)=3x2⇒2x2=4d2⇒x=22d