  The Green's function~(GF) of two localized magnetic moments embedded in the
electron gas is calculated exactly. The electrons are treated in the effective
mass approximation and the magnetic moments are coupled with electrons by a
delta-like~$s-d$ interaction. The resulting GF is obtained by the exact
summation of the Born series using a generalization of the method developed by
Slater-Koster and Ziman to non-commuting spin operators with the use of the
Woodbury identities. The exact GF crucially depends on the value of the
one-electron GF at the origin, denoted as~$g_0$. The Born series is convergent
only if~$g_0$ is finite, which holds for electrons in parabolic energy bands
in~$1D$, but not in~$2D$ and~$3D$. In the general case, the exact GF includes
nonlinear combination of localized spins operators. A method of calculating
matrix elements of these operators is given. For spins~$S_a=S_b = 1/2$ the
exact GF is expressed as a linear combination of components of~$\hS_a, \hS_b$,
and the exact range function~${\cal J}(r)$ is obtained as a double integral
over analytical expression. For electron energy~$E=0$ and~$J g_0/2 = 2$ or~$J
g_0/2=-2/3$ the range function and GF are singular. Poles of GF occur in the
vicinities of singularity points and the resulting energies of bound states are
calculated. There are three regimes of~$J$. For small $J$ the range function
resembles RKKY one: it has the same period~$\pi/k_F$, the same decay character
and a slightly different amplitude, usually within a few percent. This regime
occurs for most frequently in the nature. For~$|J|$ comparable to~$|g_0|^{-1}$
the exact range function differs qualitatively from RKKY one,. For large $|J|$
the exact range function oscillates with the same period and power-like decay
as the usual RKKY function but it has much lower amplitude decaying with
growing~$|J|$.
