I have the following relation
$$\rho = \frac{1}{x}\exp(\log(\rho) + \delta),$$
where $x$ is a number and $\rho$ and $\delta$ are matrices of size $n\times n$. I would like to solve this for $\delta$. I take logs on both sides and get
$$\log\rho = \log\rho + \delta - \log x$$
What I have written here is dimensionally inconsistent since $x$ is a number and the other terms are matrices. But I'm not sure what's wrong since taking the log seems okay. Also it seems okay to use $\log(A/B) = \log(A) - \log(B)$ since $x$ is just a number and commutes with all the matrices.
What exactly is the right solution for $\delta$? Is it $\delta = x I$, where $I$ is the appropriately sized identity matrix? Or are there some technicalities that I'm missing?
It's true that, under some assumptions, $\log (a b)= \log a + \log b$ for scalars ("numbers") and $\log (A B)= \log A + \log B$ for commuting matrices. But it's obviously false that $\log(a B)=\log a + \log B$.
Hence, you must be careful. What you can write is
$$\log a B = \log aI B=\log(aI)+\log(B)$$
Further, consider $e^{tI}= \sum_n t^nI^n/n!=e^tI$ , hence $t I = \log (e^t I) \implies \log(aI)= \log(a)I$.
Then
$$\log \frac{1}{x} M =-\log(x)I + \log(M)$$