Suppose we have two diagonal matrices
$$ A_{\mu \nu}=\left(\begin{array}{cccc} \rho(t) & 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0 \end{array}\right) $$
and $$ B_{\mu\nu}=\left(\begin{array}{cccc} 1 & 0& 0& 0\\ 0& a(t)& 0& 0\\ 0& 0& b(t)& 0\\ 0& 0& 0& 0 \end{array}\right) $$
Now if we vary $B_{\mu\nu}$ by a small amount i.e. $B_{\mu\nu}\rightarrow B_{\mu\nu}+\delta{B_{\mu\nu}}$. Does $A$ vary under this variation? I mean what is $\delta{A_{\mu\nu}}$?
If $$A_{\mu \nu}=\left(\begin{array}{cccc} \rho(a(t),b(t)) & 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0 \end{array}\right)$$ and
$$B_{\mu\nu}+\delta B_{\mu\nu}=\left(\begin{array}{cccc} 1 & 0& 0& 0\\ 0& a(t)+\epsilon h(t)& 0& 0\\ 0& 0& b(t)+\epsilon k(t)& 0\\ 0& 0& 0& 0 \end{array}\right)$$ then
$$A_{\mu \nu}+\delta A_{\mu \nu}=\left(\begin{array}{cccc} \rho(a(t)+\epsilon h(t),b(t)+\epsilon k(t)) & 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0 \end{array}\right),$$ from where
$$\delta A_{\mu \nu}=\left(\begin{array}{cccc} \rho(a(t)+\epsilon h(t),b(t)+\epsilon k(t))-\rho(a(t),b(t)) & 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0 \end{array}\right).$$ Now, an explicit expression depends on $\rho.$ For example, if $\rho(a(t),b(t))=a(t)+b(t)$ then $$\delta A_{\mu \nu}=\left(\begin{array}{cccc} \epsilon (h(t)+k(t)) & 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0 \end{array}\right)$$ and if $\rho(a(t),b(t))=a(t)\cdot b(t)$ then $$\delta A_{\mu \nu}=\left(\begin{array}{cccc} \epsilon (a(t)k(t)+b(t)h(t))+\epsilon^2 h(t)k(t) & 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0\\ 0& 0& 0& 0 \end{array}\right).$$