I am trying to find the derivative of the following function $F(X)=trace(AX^TB)$ With A is (p,p) matrix ,X a (d,p) matrix and B a (d,n) matrix I am really confused because when I compute the derivative I got $BA$ which is mathematically impossible because B is a (d,n) matrix and A is (p,p) matrix
I will really appreciate if someone can help me to figure this problem out
Thanks