# Derivative of an expression with matrix transpose

in my optimization course, we are given the following function:

$f = E^{T} C E - \lambda(E^T E - 1)$,

where $E, C$ are matrices, and $\lambda$ is a real number. In class, the lecturer wrote: $\partial L / \partial E = 0$, and then gets:

$CE + E^T C - 2\lambda E = 0$,

which is then simplified to:

$CE = \lambda E$.

Could someone explain how these last 2 lines are obtained? The partial derivative is with respect to $E$, but, how does one do it with respect to $E^T$?

Thanks! Thomas

• have to tried to write it component wise? If not, you should. – Surb Jun 18 '17 at 23:15
• No, how does one do that? – Thomas Moore Jun 18 '17 at 23:25
• well $f=g-\lambda h$ with $g=E^TCE$ and $h=(E^TE-1)$. So $f_{i,j}=g_{i,j}-\lambda h_{i,j}$ and $g_{i,j} = (E^TCE)_{i,j}=\sum_{k} (E^TC)_{i,k}E_{k,j}=\sum_{k,l}E_{l,i}C_{l,k}E_{k,j}$ etc... and then you just use what you know about computing derivatives of polynomials. – Surb Jun 18 '17 at 23:33
• This is maybe not the shortest way, but definitely the safest and once you have done several such computations you will become quick and efficient at them. – Surb Jun 18 '17 at 23:35

## 2 Answers

I don't know why you have to do the partial derivative in $E^T$ but in case you are interested in it, $\partial/\partial E^T = (\partial/\partial E)^T$.

• There is no partial derivative in $E^T$, it is the expression to differentiate which contains an $E^T$ – Surb Jun 19 '17 at 10:52
• It is asked in the question (the second to last paragraph) how to do a partial derivative in $E^T$, thus my answer. However I do not see other questions contained in this post. – Yining Wang Jun 19 '17 at 13:44

I believe there are some things in the problem that you misinterpreted, i.e. $E$ is actually a vector $e$, and $C$ is a symmetric matrix.

In that case the Lagrangian, its differential & gradient are \eqalign{ L &= e^TCe - \lambda(e^Te-1) \cr dL &= de^TCe + e^TC\,de - 2\lambda e^T\,de \cr &= e^TC^T\,de + e^TC\,de - 2\lambda e^T\,de \cr &= 2e^TC\,de - 2\lambda e^T\,de \cr &= 2(Ce-\lambda e)^T\,de \cr \frac{\partial L}{\partial e} &= 2(Ce-\lambda e) \cr } Setting the gradient to zero yields \eqalign{ Ce &= \lambda e \cr }