I have been working through the exercises for the vector calculus section to gain some practice and have got various solutions I would be grateful if the community could check (There is no solution manual for the book available).
I begin with exercise 5.6 as I would like some confirmation for both sections please For part $\boldsymbol{1}$, we are required to take the derivative of $f(\boldsymbol{t})$ wrt $\boldsymbol{t}$
$$f(\boldsymbol{t}) = sin(log(\boldsymbol{t}^T\boldsymbol{t})) $$
The inner product of $\boldsymbol{t}$ with itself should be a scalar and thus the output of $f$ should be a scalar whilst the input is $\boldsymbol{D}$ dimensional. Thus the derivative should be of dimension $1 \times \boldsymbol{D}$.
Using the chain rule I got the following:
$$ Cos(log(\boldsymbol{t}^T\boldsymbol{t}))\frac{2t_i}{log(\sum_{i}^{D} t_i^2)} \forall i \in (1,...,D)$$
Meaning that the derivative would be a row vector with each entry indexed by $i..,.,D$. Could anyone confirm if this is correct?
For part $\boldsymbol{2}$ I had more trouble, I had to take the derivative of the Trace of the matrix $\boldsymbol{AXB}$ denoted $tr(\boldsymbol{AXB})$ wrt $\boldsymbol{X}$ where:
$$A \in R^{D\times E}, X \in R^{E\times F} and B \in R^{F\times D}$$
I understand the trace is the sum of all diagonal elements of the matrix $\boldsymbol{AXB}$ s.t $$\sum_{i}^{D} (\boldsymbol{AXB})_{ii}$$ I then broke this down component wise (which I am not sure I have done correctly) to the following:
$$tr(\boldsymbol{AXB}) = \sum_{i}^{D}(\sum_{D}\sum_{E}\sum_{F} a_{d,e}x_{e,f}b_{f,d})_{i,i}$$
This would suggest that the derivative should be a $1 \times (E \times F)$ object as we are varying the trace wrt each element of the matrix $\boldsymbol{X}$
So I found that the output should be $$\sum_{D}\sum_{E}\sum_{F} a_{d,e}b_{f,d}$$ which is just the matrix $\boldsymbol{BA}$.
I am not sure if this is correct and would appreciate some feedback on where I have gone wrong.
Thank you and apologies for the lengthy post.
Both are correct.
For part $2$, note that we have $tr(AXB)=tr(BAX)$. We know hat differentiating $tr(CX)$ gives us $C$.
Hence differentiating $tr(BAX)$ gives us $BA$.