Face-to-face with a trace at the end of a calculus case - what to do next?

115 Views Asked by At

EDIT: Several have confessed, the verse makes no sense. Lest they vote it to close, I will replace it with prose.

I am interested in finding the derivative $\partial h/\partial U$ , where

$h(U) = \lambda \sum_{i,j} U_{i,j}^2$

I first replace this expression with an operator that will work better with differentials, like this one:

$\sum_{i,j} U_{i,j}^2 = tr(U^TU)$

Now I take the differential of $h$ and work it out:

$\mathbf{d}h = \lambda\mathbf{d}tr(U^TU) = \lambda tr(\mathbf{d}(U^TU)) =\lambda tr\left((\mathbf{d}U)^TU + U^T\mathbf{d}U\right)$

$=\lambda tr((\mathbf{d}U)^TU) + \lambda tr(U^T\mathbf{d}U) = \lambda tr(U^T\mathbf{d}U)+ \lambda tr(U^T\mathbf{d}U) = 2\lambda tr(U^T\mathbf{d}U)$

In order to find the derivative $\partial h/\partial U$, I need to have the $\mathbf{d}U$ term isolated at the far right of the expression. That is, I want to reduce the expression above into this form:

$\mathbf{d}h = A\mathbf{d}U$

Because then:

$\partial h/\partial U = A^T$

However, I can't figure out how to carry out this reduction, and I was wondering if someone knew what I can do next.

1

There are 1 best solutions below

0
On BEST ANSWER

Since you were already so close, this answer need not be verbose:

You've got the final formula wrong. It is: If $dh = Tr(AdU)$, then $\frac{\partial h}{\partial U} = A^T$.

Plugging this in, you have the answer is $2 \lambda U$.

One thing you could keep in mind is $\frac{\partial X}{\partial Y}$ tells you how the elements of $X$ vary with the elements of $Y$ and that gets reflected in the final dimensionality.

If $dX$ is a scalar and $Y$ is a matrix, like in the correct case, you get a matrix with the same dimensions as $Y$, with each element sort of telling you how the scalar varies with that element.

If $dX$ were a matrix, the final answer would have bigger dimensionality.

Source: Table 3.2 of Complex-Valued Matrix Derivatives by Hjørungnes.