Partial derivatives in scalar field taylor expansion

154 Views Asked by At

$\newcommand{\v}[1]{\mathbf{#1}} \newcommand{\abs}[1]{\lvert#1\rvert} \newcommand{\dd}[1]{\mathrm{d}#1}$

In our lecture notes we derived the following formula for the Taylor expansion of a scalar field:

$$f(\v{r}) = f(\v{r}_0 + \Delta \v{r}) = \sum_{j=1}^\infty \frac{1}{j!} (\Delta \v{r} \cdot \nabla)^j f \, \Big|_{\v{r}=\v{r}_0}$$

I assume that $\Delta \v{r} = \v{r} - \v{r}_0$. Furthermore, the following example of application was given:

Expand the scalar field $f(\v{r}) = 1/\abs{\v{r}}$ around a point $\v{r}_0 \neq \v{0}$. We obtain $$\partial_x f = -\frac{1}{2} \frac{2x}{(x^2 + y^2 + z^2)^{3/2}} = -\frac{x}{\abs{\v{r}}^3}$$ By symmetry, it obviously follows that $\nabla f = -\v{r}/\abs{\v{r}}^3$. Thus, up to the first order term, the expansion is $$f(\v{r}_0 + \Delta \v{r}) = \frac{1}{\v{r}_0} - \frac{\Delta \v{r} \cdot \v{r}_0}{\abs{\v{r}_0}^3} + \ldots$$ Taking the derivative of that new term: $$\partial_x \left( -\frac{\Delta \v{r} \cdot \v{r}}{\abs{\v{r}}^3} \right) = -\frac{\Delta x}{\abs{\v{r}^3}} + \frac{3}{2} \frac{\Delta \v{r} \cdot \v{r}}{\abs{\v{r}}^5} 2x$$ $\ldots$

The last step is where I can't follow anymore. So we use the product rule, the numerator and denominator being the two factors we want to differentiate. So for the numerator we apparently have

$$\partial_x (\Delta \v{r} \cdot \v{r}) = \Delta x \tag{1}$$

I do not see why that is the case. The product rule for vectors is $$\frac{\mathrm{d}}{\dd{x}} (\v{a} \cdot \v{b}) = \frac{\dd{\v{a}}}{\dd{x}} \cdot \v{b} + \v{a} \cdot \frac{\dd{\v{b}}}{\dd{x}}$$

Looking back at $(1)$, $\Delta \v{r} = \v{r} - \v{r}_0$ and $\v{r}$ are both functions of $x$ (as $\v{r} = (x,y,z)^T$). Hence, should we not get

$$\begin{align*} \partial_x (\Delta \v{r} \cdot \v{r}) &= \partial_x \left[ \begin{pmatrix} x - x_0 \\ y - y_0 \\ z - z_0 \end{pmatrix} \cdot \begin{pmatrix} x \\ y \\ z \end{pmatrix} \right] \\ &= \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} \cdot \begin{pmatrix} x \\ y \\ z \end{pmatrix} + \begin{pmatrix} x - x_0 \\ y - y_0 \\ z - z_0 \end{pmatrix} \cdot \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} \\ &= x + x - x_0 \\ &= x + \Delta x \end{align*}$$

1

There are 1 best solutions below

0
On

The Taylor expansion writes $$ f(\mathbf{r})= f(\mathbf{r}_0) +(\mathbf{r}-\mathbf{r}_0)^T \mathbf{g}_f(\mathbf{r}_0) +\frac12 (\mathbf{r}-\mathbf{r}_0)^T \mathbf{H}_f(\mathbf{r}_0) (\mathbf{r}-\mathbf{r}_0) + \ldots $$

The gradient vector is found using the differential: \begin{eqnarray*} df &=& - \frac{d\| \mathbf{r} \|}{\| \mathbf{r} \|^2} = - \frac{\mathbf{r} : d\mathbf{r}}{\| \mathbf{r} \|^3} \\ &=& \mathbf{g}_f(\mathbf{r}) : d\mathbf{r} \end{eqnarray*} since $d\| \mathbf{r} \|^2 = 2\mathbf{r} : d\mathbf{r} = 2\| \mathbf{r} \| d\| \mathbf{r} \|$.

Here the colon operator denotes the Frobenius inner product (here the usual vector product).

The Hessian is also found using the differential: \begin{eqnarray*} d \mathbf{g}_f &=& +3 \frac{\mathbf{r}\ d\| \mathbf{r} \| }{\| \mathbf{r} \|^4} - \frac{d\mathbf{r}}{\| \mathbf{r} \|^3} \\ &=& \frac{1}{\| \mathbf{r} \|^3} \left( 3 \frac{\mathbf{r}\mathbf{r}^T}{\| \mathbf{r} \|^2} - \mathbf{I}_3 \right) d\mathbf{r} \\ &=& \mathbf{H}_f(\mathbf{r}) d\mathbf{r} \end{eqnarray*}

The Taylor expansion writes $$ f(\mathbf{r}) \simeq f(\mathbf{r}_0) - \frac{(\mathbf{r}-\mathbf{r}_0)^T \mathbf{r}_0}{\| \mathbf{r}_0 \|^3} + \frac{1}{2\| \mathbf{r}_0 \|^3} (\mathbf{r}-\mathbf{r}_0)^T \left( 3 \frac{\mathbf{r}_0\mathbf{r}_0^T}{\| \mathbf{r}_0 \|^2} - \mathbf{I}_3 \right) (\mathbf{r}-\mathbf{r}_0) $$