What is the derivative of the symmetric bilinear form $$ f_X(\mathbf{a},\mathbf{b}) = \mathbf{a}^T X \mathbf{b} $$ with respect to the (symmetric) matrix $X$?
Following Wikipedia, and using the denominator layout, I would say $$ \frac{\partial f_X}{\partial X}(\mathbf{a},\mathbf{b}) = \mathbf{a}\mathbf{b}^T $$
But since $f_X$ is symmetric, $f_X(\mathbf{a},\mathbf{b}) = f_X(\mathbf{b},\mathbf{a})$. If I derive this equality I obtain $$ \frac{\partial f_X}{\partial X}(\mathbf{a},\mathbf{b}) = \frac{\partial f_X}{\partial X}(\mathbf{b},\mathbf{a}) \qquad\Rightarrow\qquad \mathbf{a}\mathbf{b}^T = \mathbf{b}\mathbf{a}^T $$ which is wrong because $\mathbf{a}\mathbf{b}^T \neq \mathbf{b}\mathbf{a}^T$
Where am I wrong?
Wikipedia has calculated the gradient with respect to an unconstrained $X$ matrix, i.e. $$G = ab^T$$ To enforce the symmetry constraint, the result should be symmetrized $$\eqalign{ G_{sym} &= \tfrac 12(G+G^T) \;=\; \tfrac 12(ab^T + ba^T) }$$