# What is the derivative of the function involving inner product $f(x)=\langle Ax,Bx\rangle$

I want to find the first and second derivative of $$f(x)=\langle Ax,Bx\rangle$$, where $$\langle\,,\rangle$$ is the inner product, A and B are $$n\times n$$ matrices and $$x\in \mathbb{R}^n$$.
Here's my thoughts:
Since A and B are linear transformations, their derivatives are themselves. So maybe we can treat f as a function from $$\mathbb{R}^n\times \mathbb{R}^n$$ to $$\mathbb{R}$$?

As the inner product is defined by $$\langle u, v\rangle = u^Tv$$ we can reformulate your function to $$f(x) = (Ax)^TBx = x^TA^TBx$$
As seen here: Differentiate $f(x)=x^TAx$ you get the derivative $$f'(x) = 2x^TA^TB$$ Calculating the next derivative should be much easier now.
• $A^TB$ is not necessarily symmetric. – user10354138 May 10 at 11:51
• Oh you're right, I oversaw that. I didn't find a formula for the derivative of $x^TAx$ to the fast, but I'm sure there is one – LegNaiB May 10 at 12:03