Taylor Expansion of Inverse of Difference of Vectors I am trying to derive the multipole moment of a gravitational potential, but I'm getting stuck on some math I believe.  So basically the problem is finding the Taylor Expansion for $$\frac{1}{|\mathbf{x}-\mathbf{x'}|}=\frac{1}{\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}}.$$  The expansion is supposed to be around $\mathbf{x'}=0$.  
I have two questions: 1) Do I take the partial derivatives in terms of x or x' (I'm thinking it should be just x, but I'm not sure)?  2) When I'm supposed to multiply by a factor that is the equivalent of $(x-a)$, what should that be?  I was thinking I should just dot with x', but that doesn't give me the correct answer.

The multivariable Taylor expansion is probably most easily written as
$$ f(\mathbf{x+h}) = \sum_{k=0}^{\infty} \frac{1}{k!} \sum_{i_1,i_2,\dotsc,i_k=1}^n (\partial_{x_{i_1}} \partial_{x_{i_2}} \dotsm \partial_{x_{i_k}} f(\mathbf{x}) ) h_{i_1} h_{i_2} \dotsm h_{i_k} $$
(which keeps all terms of the same order together), so the first few terms are
$$ f(\mathbf{x}) + \mathbf{h} \cdot \nabla f(\mathbf{x}) + \mathbf{h} \cdot (Hf(\mathbf{x}))\mathbf{h} + \dotsb $$
However, probably the simpler way in this case is to write
$$ \lvert \mathbf{x-x'} \rvert^{-1} = (|\mathbf{x}|^2+2\mathbf{x\cdot x'}+|\mathbf{x'}|^2)^{-1/2}. $$
Setting $|\mathbf{x}|=R$, $|\mathbf{x}|=r$, and $\mathbf{x\cdot x'} = 2rR\cos{\theta}$, where $\theta$ is the angle between the vectors, we have
$$ \lvert \mathbf{x-x'} \rvert^{-1} = R^{-1}(1+2r/R \cos{\theta}+r^2/R^2)^{-1/2}. $$
Setting $r/R=s$, we can now expand this as a function of $s$ using the binomial theorem:
$$\begin{align*}
\frac{1}{\lvert \mathbf{x-x'} \rvert} &= \frac{1}{R}(1+2s \cos{\theta}+s^2)^{-1/2} \\
&= \frac{1}{R} \left( 1 - \frac{1}{2}(2s \cos{\theta}+s^2) + \frac{-1}{2}\frac{-3}{2}\frac{1}{2!}(2s \cos{\theta}+s^2)^2 + O(s^3) \right) \\
&= \frac{1}{R} \left( 1 - s\cos{\theta} - \frac{1}{2}s^2 + \frac{3}{2}s^2 \cos^2{\theta} + O(s^3) \right) \\
&= \frac{1}{R} - \frac{s\cos{\theta}}{R} - \frac{1}{2R}(3 \cos^2{\theta}-1)s^2 + O(s^3)
\end{align*}$$
Resubstituting, we get the multipole expansion
$$ \frac{1}{\lvert \mathbf{x-x'} \rvert} = \frac{1}{\lvert \mathbf{x} \rvert} - \frac{\mathbf{x \cdot x'}}{\lvert \mathbf{x} \rvert^2} + \frac{1}{2} \frac{3(\mathbf{x \cdot x'})^2-\lvert \mathbf{x'} \rvert^2}{\lvert \mathbf{x} \rvert^5} + O(\lvert \mathbf{x'} \rvert^3/\lvert \mathbf{x} \rvert^4) $$

To actually answer your questions,


*

*Since $\lvert \mathbf{x -x'} \rvert=\lvert \mathbf{x'-x} \rvert$, here it doesn't actually matter. You're taking derivatives of the function $\lvert \mathbf{x} \rvert^{-1}$ and evaluating them at $\mathbf{x}$.

*You are correct in dotting with $\mathbf{x'}$: notice that the third term in the expansion, for example, is
$$ \sum_{i,j=1}^3 \frac{3x_i x_j- \delta_{ij}}{2\lvert \mathbf{x} \rvert} x'_i x'_j. $$

