# Compute Taylor expansion of a vectorial function

I'm not sure this question even deserves to be posted on this great forum, but I've been stuck the past 2 hours on a relatively easy thing.

Context: (in case it helps)

Im trying to study stability of Lagrangian points in a 3 body problem:

In the picture $$S$$ denotes the sun, $$J$$ Jupiter and $$L_4$$ the equilibrium solution for an asteroid with relatively small mass. $$R$$, defined as $$d(S,J)$$ is the length of the edges of the equilateral triangle.

Now the idea is to perturb the position of $$\vec{y_4}=L_4$$ hence we set $$\vec{y}=\vec{y_4}+\vec{z}$$ for a "small perturbation $$\vec{z}"$$

This is what follows ($$d_i:=||\vec{y_4}-\vec{y_i}||$$, for $$i=S,J )$$

My interpretation: I believe this is the Taylor expansion of the function $$f(\vec{y})=\frac{\vec{y}-\vec{y_i}}{||\vec{y}-\vec{y_i}||^3}$$ around $$\vec{y_4}$$ evaluated at $$\vec{y_4}+\vec{z}$$ My calculations:

$$f'(\vec{y})=\frac{1}{||\vec{y}-\vec{y_i}||^3}-3\frac{\vec{y}-\vec{y_i}}{||\vec{y}-\vec{y_i}||^4} \\ f(\vec{y_4}+\vec{z})=f(\vec{y_4})+f'(\vec{y_4})\cdot \vec{z}+\mathcal{O}(\vec{z}^2)$$

Clearly there are problems with my derivative (first term is a scalar unless I interpret $$\vec{1}=(1,1,1)$$). Although if I evaluate the derivative at $$y_4$$ I get an expression very similar to the one in the image, but still with mixed scalars and vectors.

I'm pretty sure there is some theory on how to handle these functions, but I have never really handled these expressions in 2 years of mathematics and I have no clue on how to fix my lack of knowledge in this context.

• When in doubt, do everything in components. Apr 7 at 15:54

The function of concerned: $$\vec{s}_i = \frac{\vec{y}-\vec{y}_i}{\Vert \vec{y}-\vec{y}_i \Vert^3}$$ where $$\vec{y} =\vec{y}_4 + \vec{z}$$, and $$\vec{z}$$ is of small magnitude to be expanded to the first order of $$z$$.

$$\tag{1} \vec{s}_i = \frac{\vec{y}_4 +\vec{z} -\vec{y}_i}{\Vert \vec{y}-\vec{y}_i \Vert^3} = \frac{\vec{y}_4 -\vec{y}_i}{\Vert \vec{y}-\vec{y}_i \Vert^3} + \frac{\vec{z} }{\Vert \vec{y}-\vec{y}_i \Vert^3} \approx \frac{\vec{y}_4 -\vec{y}_i}{\Vert \vec{y}-\vec{y}_i \Vert^3} + \frac{\vec{z} }{\Vert \vec{y}_4-\vec{y}_i \Vert^3}$$ The second term is already of order $$z$$, therefore in the denominator, the $$\vec{y}$$ can be replaced by $$\vec{y}_4$$. Denote the distance $$d_i \equiv \Vert\vec{y}_4 - \vec{y}_i\Vert$$.

Now, the equstion is concerned about the Taylor expansion of the denominator in series of small $$\vec{z}$$: $$f(\vec{y}_4 + \vec{z}) = f(\vec{y}_4) + \vec{\nabla}_z f\Big\vert_{\vec{z}=0} \cdot \vec{z} + \sum_{i,j} \frac{1}{2} \frac{\partial^2 f}{\partial z_i \partial z_j}\Big\vert_{\vec{z}=0} z_i z_j + ...$$

Apply the Taylor expansion to the denominator: $$\tag{2} \frac{1}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^3} = \frac{1}{\Vert \vec{y}_4-\vec{y}_i \Vert^3} + \vec{\nabla}_z \left[\frac{1}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^3}\right]_{\vec{z}=0} \cdot \vec{z}$$

Calculate the gradient term: $$\tag{3} \vec{\nabla}_z \left[\frac{1}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^3}\right] =-3 \left[\frac{1}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^4}\right] \vec{\nabla}_z \Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert \\ = -3\left[\frac{1}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^4}\right]\frac{\vec{y}_4-\vec{y}_i+\vec{z}}{\Vert\vec{y}_4-\vec{y}_i+\vec{z}\Vert}=-3\frac{\vec{y}_4-\vec{y}_i+\vec{z}}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^5}$$

Substitue Eq.(3) with $$\vec{z}= 0$$ into Eq.(2) $$\tag{4} \frac{1}{\Vert \vec{y}_4-\vec{y}_i+\vec{z} \Vert^3} = \frac{1}{\Vert \vec{y}_4-\vec{y}_i \Vert^3} - 3 \frac{\left(\vec{y}_4-\vec{y}_i\right) \cdot \vec{z}}{\Vert \vec{y}_4-\vec{y}_i\Vert^5} = \frac{1}{d_i^3} - 3 \frac{\left(\vec{y}_4-\vec{y}_i\right) \cdot \vec{z}}{d_i^5}$$

Plug the result of Eq.(4) into Eq.(1): $$\tag{1} \vec{s}_i \approx \frac{1}{d_i^3}\left(\vec{y}_4-\vec{y}_i\right) - 3 \frac{\left(\vec{y}_4-\vec{y}_i\right) \cdot \vec{z}}{d_i^5} \left(\vec{y}_4-\vec{y}_i\right)+ \frac{\vec{z} }{d_i^3}$$