Vector by vector derivative

I want to solve the derivative of $$\mathbf{f}=\mathbf{a}^T\mathbf{x}\mathbf{c}^T$$ with respect to $$\mathbf{x}$$, where $$\mathbf{a}$$ and $$\mathbf{x}$$ are $$M\times 1$$ vectors, and $$\mathbf{c}$$ is a $$N \times 1$$ vector. $$\mathbf{a}$$ and $$\mathbf{c}$$ are independent of $$\mathbf{x}$$. I tried the following procedure: $$\partial\mathbf{f} = \mathbf{a}^T\partial\mathbf{x}\mathbf{c}^T=\mathbf{c}^T\mathbf{a}^T\partial\mathbf{x}$$ But I cannot directly get $$\frac{\partial\mathbf{f}}{\partial\mathbf{x}}$$. Could someone please help me with this derivative? Thanks.

• What is the context? What are the sizes of the vectors? And, are $\mathbf a$ and $\mathbf c$ constant vectors or do they depend on $\mathbf x$ ? Without further context and some details on your attempts towards a solution, your question is phrased as an isolated question and is unlikely to get an answer here. Jul 8, 2022 at 6:00
• In general, the equality $$\mathbf{a}^T\partial\mathbf{x}\mathbf{c}^T=\mathbf{c}^T\mathbf{a}^T\partial\mathbf{x}$$ does not hold unless the matrices commute. Jul 8, 2022 at 6:01
• @sadman-ncc, Thanks, I have edited it. Now, the equality $\mathbf{a}^T\partial\mathbf{x}\mathbf{c}^T=\mathbf{c}^T\mathbf{a}^T\partial\mathbf{x}$ holds, because $\mathbf{a}^T\partial\mathbf{x}$ is a scalar.
– ZYX
Jul 8, 2022 at 6:09
• You can use this online tool to compute derivatives of scalars/vectors/matrices. It's really great to do actual computations.
– PC1
Jul 8, 2022 at 6:18
• @PC1.Thanks! But I found the results of $\frac{\partial\mathbf{a}^T\mathbf{x}\mathbf{c}^T}{\partial\mathbf{x}}$ and $\frac{\partial\mathbf{a}^T\mathbf{x}\mathbf{c}}{\partial\mathbf{x}}$ are the same, but I do not know the procedure.
– ZYX
Jul 8, 2022 at 6:26