# Change the trace of a Matrix

I want to know if I have a matrix $A \in \mathbb{M}_{n\times n}(\mathbb{K})$ and I want to change the trace multiplying it by a number $\beta \in \mathbb{K}$: $$A=\left( \begin{array}{ccc} \alpha_{11} & ... & \alpha_{1n} \\ \vdots & & \vdots \\ \alpha_{n1} & ... & \alpha_{nn} \end{array} \right) \to B=\left( \begin{array}{cccc} \beta \alpha_{11} & \alpha_{12} & ... & \alpha_{1n} \\ \alpha_{21} &\beta\alpha_{22} & & \vdots \\ \vdots & & & \vdots \\ \alpha_{n1} & ... & ... & \beta\alpha_{nn} \end{array} \right)$$ There exist some $X \in \mathbb{M}_{n\times n}(\mathbb{K})$ s.t $A\times X = B$ and if it exist, what form does it have. Thanks

• Something like $\beta \times I_n$ ? – Atmos Sep 6 '18 at 17:44
• @Atmos, No, that multiply every element of A by $\beta$ – J.Rodriguez Sep 6 '18 at 17:47
• Ah, I thought only the trace interested you, sorry ^^ – Atmos Sep 6 '18 at 18:01
• If $A^{-1}$ exists, then $X = A^{-1}B$. I think diagonalization of $A$ can be used to find $X$. – Math Lover Sep 6 '18 at 18:11

As MathLover points out in comments, if $A$ is invertible, then the answer is yes. Here's how to do it:
Write $B$ as $B= A + D$ where $D$ is the diagonal matrix (the trace adjustment), in your case $d_{ii} = (\beta-1)a_{ii}$. Then you want to find some X so that $AX = B = (A+D)$. Then, just solve for $X$.
In general, if $A$ is not invertible you can't guarantee that this can be done. Take as a simple case $A=\mathbb{1}_{2,2}$ (the all-ones matrix, 2x2). And take $B=A+I$ (i.e. multiply the diagonal of $A$ by 2). If you write down the system of equations from $AX=B$ you'll quickly see it isn't possible to solve.