Is the derivative of $\pmb x^\top (I+GB)^{-\top} (I+GB)^{-1}\pmb x$ with respect to $B$ a 4th-order tensor?
Where $\pmb x$ is a vector, and $B$ is a matrix.
I followed the procedures in What is the derivative of $x^T A A^T x$ with respect to $A$? and arrived at $2\pmb x\pmb x^\top(I+GB)^{-1} : -(I+GB)^{-\top}⊗(I+GB)G$, with the ":" sign denoting the Frobenious product. But here is the problem: the function is from $\mathbb{R}^{n\times n}$ to $\mathbb{R}$, which implies that the derivative w.r.t. $B$ should be a matrix instead of a tensor!
Can anybody help me with this? Thanks in advance!
What you did was right: The function is indeed from $\Bbb R^{n×n}$ to $\Bbb R$, and the derivative with respect to $B$ is indeed a matrix. The multiplication by $\pmb x$ and $\pmb x^\top$, in each case, effectively reduces the dimension of the tensor by $1$. Also, note that a matrix is a two-dimensional tensor.