1

How to find the following partial derivative

\begin{align} \frac{\partial}{\partial x_i} ( {\bf x}-{\bf c})^T A ( {\bf x}-{\bf c}), \end{align}

where ${\bf x}$ is a vector of length $n$ and $A$ is a strictly positive definite matrix, and ${\bf c}$ is just a fixed vector.

My plan was to re-write it in terms of a double sum and take the derivative.

Lisa
  • 2,941

1 Answers1

1

I like the approach of using the definition of the partial derivative. In particular, $$ \frac{\partial}{\partial x_i} f(\mathbf x) = \lim_{t \to 0} \frac{f(\mathbf x + t\mathbf e_i) - f(\mathbf x)}{t} $$ where $\mathbf e_i$ denotes the $i$th canonical basis vector. With that, we have $$ f(\mathbf x + t\mathbf e_i) = ([\mathbf x - \mathbf c] + t\mathbf e_i )^TA([\mathbf x - \mathbf c] + t\mathbf e_i)\\ = f(\mathbf x) + t[(\mathbf x - \mathbf c)^TA\mathbf e_i + \mathbf e_i^T A(\mathbf x - \mathbf c)] + t^2 \mathbf e_i^T A \mathbf e_i. $$ Notably, we have $$ [(\mathbf x - \mathbf c)^TA\mathbf e_i]^T = \mathbf e_i^T A^T(\mathbf x - \mathbf c) $$ and any scalar is equal to its own transpose. So, the above simplifies to $$ f(\mathbf x + t\mathbf e_i) = f(\mathbf x) + t[\mathbf e_i^T (A + A^T)(\mathbf x - \mathbf c)] + t^2 \mathbf e_i^T A \mathbf e_i. $$

Ben Grossmann
  • 225,327