Can you move the integral inside trace function?

216 Views Asked by At

Suppose that $C, A(x) \in \mathbb{R}^{n,n}$ and $x \in (0,1)$. I want to compute the following integral

$$\int_{0}^1 \text{Tr}(C A(x) C^\intercal) dx,$$

where $C$ does not depend on $x$. I know that $\int_{0}^1 A(x) dx = B$. So I wrote

$$\int_{0}^1 \text{Tr}(C A(x) C^\intercal) dx = \text{Tr} (C \int_{0}^1 A(x) dx C^\intercal) = \text{Tr}(CAC^\intercal).$$

I wrote this because trace is the sum of diagonal elements and integral of sum can be written as sum of integrals. Is my derivation correct in general?