Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to differentiate the function $u$ shown below with respect to a vector $\psi$: ($a, c$ and $f$ are constants)

$$u(\psi) =\left[\begin{array}{cccc} a & f & 0 & 0\\ c & a & f & 0\\ 0 & c & a & f\\ 0 & 0 & c & a \end{array}\right]\left[\begin{array}{c} \psi^{1}\\ \psi^{2}\\ \psi^{3}\\ \psi^{4} \end{array}\right]$$

I'm thinking that the answer would be: $\left[\begin{array}{cccc} a & f & 0 & 0\\ c & a & f & 0\\ 0 & c & a & f\\ 0 & 0 & c & a \end{array}\right]$ by working out the derivative of each term of the matrix with respect to its corresponding $\psi$. But I was hesitant that the function could be written as:

$u=\left[\begin{array}{c} a\psi^{1}+f\psi^{2}\\ c\psi^{1}+a\psi^{2}+f\psi^{3}\\ c\psi^{2}+a\psi^{3}+f\psi^{4}\\ c\psi^{3}+a\psi^{4} \end{array}\right]$ and hence its derivative will just be: $\left[\begin{array}{c} a\\ a\\ a\\ a \end{array}\right]$, if the rows were differentiated with respect to only the corresponding $\psi$. Please let me know which is correct. I think the first one, but need to be sure.

share|cite|improve this question
up vote 3 down vote accepted

The answer does depend on what you mean by "derivative". Your function $u$ appears to be a nice linear function $u:\mathbb{R}^4 \rightarrow \mathbb{R}^4$. Most of the time when one says they want to take "the derivative" of a function, $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$ at $\vec{x} = \vec{a} $ they mean they want the linear function $Df_{\vec{a}}: \mathbb{R}^n \rightarrow \mathbb{R}^m$ that satisfies the condition:

$$\lim_{\vec{x} \rightarrow \vec{a}} \frac{|f(\vec{x}) - f(\vec{a})-Df_{\vec{a}}(\vec{x})|}{|\vec{x} - \vec{a}|} = 0 $$

Assuming such a $Df$ exists it turns out to be given by the matrix with rows equal to the gradients of the components of $f$. So in your case, $u= (a \psi^1 + f \psi^2, c \psi^1 + a \psi^2 + f \psi^3,c \psi^2 + a \psi^3 + f \psi^4, c \psi^3 + a \psi^4) = (u_1,u_2,u_3,u_4)$ the derivative $Du$ is given by:

$$\left( \begin{array}{c} \nabla u_1\\ \nabla u_2 \\ \nabla u_3 \\ \nabla u_4 \end{array} \right) % =\left( \begin{array}{cccc} a & f & 0 & 0 \\ c & a & f & 0 \\ 0 & c & a & f \\ 0 & 0 & c & a \\ \end{array} \right) $$

Which was your first instinct! Go withyour gut!

share|cite|improve this answer

You have


and so


that is your original matrix.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.