(1) We are given $A,B \in R^{n\times n}$ diagonal matrices of n rows and n columns with real values.
Show that there are $X \in R^{n\times n}$ and polynomials $q$ and $p$ such that:
$$q(X)=B \text{ and }p(X)=A$$
What I've tried doing:
I've tried a different combinations of X and p,q, for example:
If we say that $X=A$ and we define $q(X) = X-A+B$ and $p(X)=X$ we indeed solve the problem BUT those p and q are not polynomials, because if i use a scalar as an input for those polynomials instead of a matrix, it doesn't work. There is no scalar version of the matrix A (Unlike for example the unit matrix, which the scalar version of which is 1) So that isn't the way to solve the question
(2) Is this correct for any 2 matrices or just for diagonal matrices? Hint: What basic difference is there between the polynomial ring and the matrix ring?
(Haven't started working on this yet cause didn't solve question 1, but it probably involves that the matrix multiplication isnt commutative)