# Derivative of Matrix elements w.r.t. to scalar

First of all, excuse the stupid question. Unfortunately, I couldn't find something similar already asked.

Consider the matrix

$$A(r_1, r_2) = \begin{pmatrix} r_1^2 & 3 \\ 2 & r_2 \end{pmatrix}.$$

I'd like to know how I can get the Jacobian of this matrix. I'd suggest it's something like:

\begin{align*} \frac{\partial A(r_1, r_2)}{\partial r_1} &= \begin{pmatrix} 2r_1 & 0 \\ 0 & 0 \end{pmatrix} \\ \frac{\partial A(r_1, r_2)}{\partial r_2} &= \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} \end{align*}

But what mathematical object is the Jacobian of the Matrix $$A$$? Is it a matrix with three dimensions? Any help or hints for useful links are really appreciated.

The problem is that you do not define your "space" of matrices. The easiest way to think of $$2\times 2$$ matrices is as $$\mathbb{R}^4$$ vectors. Then, the Jacobian of $$A:\mathbb{R}^2\to\mathbb{R}^4$$ is a $$4\times 2$$ matrix: $$J_A=\begin{pmatrix} 2r_1 & 0\\ 0 & 0\\ 0 & 0\\ 0 & 1\\ \end{pmatrix}$$