Physics for Scientists and Engineers: A Strategic Approach with Modern Physics (4th Edition)

First, $E \propto \frac{1}{r}$ $E_1 \propto \frac{1}{r_1}$ $E_2 \propto \frac{1}{r_2}$ We can use the ratio of $\frac{E_2}{E_1}$ to find $E_2$; $\frac{E_2}{E_1} = \frac{r_1}{r_2}$ $E_2 = \frac{E_1~r_1}{r_2}$ $E_2 = \frac{(1.0~J)(30~nm)}{20~nm}$ $E_2 = 1.5~J$ If they are 20 nm apart, the potential energy is 1.5 J.