I am trying to calculate the following means:

$$ E[ (x-\mu_k)b^T(x-\mu_l)(x-\mu_l)^T ] $$

$$ E[ (x-\mu_k)(x-\mu_k)^TA(x-\mu_l)(x-\mu_l)^T ] $$

Where x is some multivariate gaussian random variable.

I have tried using the following formulas from 'The Matrix Cookbook' but without any success.

I would like to adapt my equation to the above formula.

## Best Answer

I found a little trick,

for the first mean, I separated it into 2 means:

$$ E[ (x-\mu_k)b^T(x-\mu_l)(x-\mu_l)^T ] = E[ (x-\mu_l)b^T(x-\mu_l)(x-\mu_l)^T ] + (\mu_l-\mu_k)b^T E[(x-\mu_l)(x-\mu_l)^T ] $$

Which is easily solvable using the above equations.

For the second mean I used the same principle.