From Wikipedia: "The electric potential created by a point charge q, at a distance r from the charge (relative to the potential at infinity), can be shown to be ." Since the potential is the potential energy of the test charge divided by the test charge itself, you know the energy of the test charge at . Similarly, you know the energy of the test charge at as an expression of . Finally, you know the difference of these energies, which is the work done by the electric force. From here, you can find .