Let $f,g:\mathbb{R\to R}$ be analytic functions and consider the matrix $$A(x)=\begin{pmatrix}f(x)&g(x)\\1&0\end{pmatrix}.$$ Assume $f(x)\neq g(x)$ at every point $x\in\mathbb R$. Give an example for a non-singular matrix $B(x)$ for which $$A(x)B(y)-A(y)B(x)=0.$$
I tried writing $B(x)=\begin{pmatrix}a(x)&b(x)\\c(x)&d(x)\end{pmatrix}$ explicitly and solving the equations but it just seems too complicated. Is there any other way to find such $B$?
An example is $$ A(x) = \pmatrix{1 & g(x)\cr 1 & 0\cr},\ B(x) = \pmatrix{a & b\cr c g(x) & d g(x)\cr}$$ where $ad - bc \ne 0$, and $g(x) \ne 1$.