# why the vector derivative of $\frac{d(x^Ta)}{dx} = \frac{d(a^Tx)}{dx} = a^T$, why it's $a^T$ not $a$

$\frac{d(x^Ta)}{dx} = \frac{d(a^Tx)}{dx} = a^T$

I was confused by this simple formula for a few weeks.

I thought $x^Ta$ is an scalar, and it's derivative respect to a column vector should be an vector, e.g. $a$ instead of $a^T$.

am I missing something?

Thank you !!

• I think it has to do with the fact that the scalar product is defined as $\square \cdot \triangle = \square^\intercal \triangle$ Jan 5, 2016 at 16:53
• If $f:\mathbb R^n \to \mathbb R^m$, then $f'(x)$ is an $m \times n$ matrix. Jan 5, 2016 at 17:45
• @ja72 I notice one paradox: could you please explain how this happens? Thank you! $\mathbf{a^T} \frac{d\mathbf{x}}{d\mathbf{x}} = \mathbf{a^T}$ \\ $\frac{d\mathbf{x^T}}{d\mathbf{x}} \mathbf{a} = \mathbf{a}$
– Long
Jan 6, 2016 at 9:59
• @littleO you mean the Jacobian Matrix? why it's a row vector when the gradient is a column vector? Thank you !
– Long
Jan 6, 2016 at 10:02
• @Long replace all $\square^\intercal$ with $\square \cdot$ and see if it makes sense. The transpose is part of an inner product in vector space. Jan 6, 2016 at 13:37

Here's the definition of the derivative of a function $y: \Bbb R^n \to \Bbb R$ wrt the column vector $\mathbf x$. $$\frac{dy(\mathbf x)}{d\mathbf x} := \pmatrix{\frac{\partial y(\mathbf x)}{\partial x_1}, \dots, \frac{\partial y(\mathbf x)}{\partial x_n}}$$ Notice that this is a row vector (by definition).
$y(\mathbf x) = \mathbf a^T\mathbf x$ is a scalar function so the result of differentiating it wrt $\mathbf x$ must be some row vector. Now I assume you can prove that $\frac{d\mathbf a^T\mathbf x}{d\mathbf x} = \mathbf a^T = \frac{d\mathbf x^T\mathbf a}{d\mathbf x}$ in this case?