Total electrostatic energy of the system is the sum of:
(i) Mutual interaction energy between the two charges
(ii) Potential energy of charges due to the external field
Distance between the two charges is
$$ r_{12}=18\,cm=0.18\,m $$
Interaction energy:
$$ U_{12}=\frac{1}{4\pi\varepsilon_0}\frac{q_1q_2}{r_{12}} $$
$$ U_{12}=9\times10^9 \times \frac{(7\times10^{-6})(-2\times10^{-6})}{0.18} $$
$$ U_{12}=-0.7\,J $$
Potential due to external field
Given
$$ \vec{E}=\frac{A}{r^2}\hat{r} $$
Potential is obtained from
$$ E=-\frac{dV}{dr} $$
$$ V(r)=\frac{A}{r} $$
For both charges,
$$ r=9\,cm=0.09\,m $$
$$ V=\frac{9\times10^5}{0.09}=10^7\,V $$
External field energy:
$$ U_{ext}=q_1V+q_2V=(7-2)\times10^{-6}\times10^7 $$
$$ U_{ext}=50\,J $$
Total electrostatic energy:
$$ U=U_{12}+U_{ext} $$
$$ U=50-0.7=49.3\,J $$
Final Answer: $$ \boxed{49.3\;J} $$
Updated for JEE Main 2026: This PYQ is important for JEE Mains, JEE Advanced and other competitive exams. Practice more questions from this chapter.