Derivative involving inner product

1.6k Views Asked by At

How would I take the derivative of a function $$f(x) = \langle x,x \rangle=x^{T}x?$$ The answer seems to be $2x$ but I don't know how to explicitly show this other than saying "there are $2 x$'s being operated on so just take down the power two and we have one $x$ leftover i.e. the power rule". I don't know how to get the derivative of $$x^{T}Ax$$ from this either. Is it just $2Ax$?

1

There are 1 best solutions below

2
On BEST ANSWER

We have $$\def\\#1{{\bf#1}} \\x^T\\x=x_1^2+\cdots+x_n^2$$ and so $$\nabla(\\x^T\\x)=\frac{\partial}{\partial x_1}(\\x^T\\x)\\e_1+\cdots+\frac{\partial}{\partial x_n}(\\x^T\\x)\\e_n =2x_1\\e_1+\cdots+2x_n\\e_n =2\\x\ .$$ It is easy to check in the $2\times2$ case that $$\nabla(\\x^TA\\x)=(A+A^T)\\x\ ,$$ and if $A$ is symmetric (which may well be the case in this kind of problem) this simplifies to $2A\\x$. If $n>2$ the same result is true though a bit more intricate to confirm.