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'm solving a problem and I'm having difficulties in calculation of the determinants of two matrices.

There is two $N\times N$ matrices:

$$\left( \begin{array}{cccc} a & 1 & \ldots & 1 \\ 1 & a & \ldots & \vdots \\ \vdots & \ldots & \ddots & 1 \\ 1 & \ldots & 1 & a \\ \end{array} \right)$$ where $a\in \mathbb{R}$

and $$\left( \begin{array}{cccc} a_1 & 1 & \ldots & 1 \\ 1 & a_2 & \ldots & \vdots \\ \vdots & \ldots & \ddots & 1 \\ 1 & \ldots & 1 & a_n \\ \end{array} \right)$$ where $a_1,\ldots,a_n\in \mathbb{R}$

I've tried to get recursive formula, but I have no result.

If someone could help or give me any links I would be grateful.

share|cite|improve this question
Hint: Try subtracting the last row from all the others – Alexander Sep 7 '13 at 14:49
up vote 3 down vote accepted

I will look at a slightly different case, where in the diagonal there isn't $a$ or $a_i$ but $1+a$ and $1+a_i$, which makes the results much nicer.


If you ask Mathematica

Det[#] &@
   (ConstantArray[1, {#, #}] + a*IdentityMatrix[#]) & /@ 

(which is in fact asking the determinant of your matrix in the cases where $n$ is somewhere between $1$ and $10$) you get the answer

\begin{array}{} a+1\\ a^2+2 a\\ a^3+3 a^2\\ a^4+4 a^3\\ a^5+5 a^4\\ a^6+6 a^5\\a^7+7 a^6\\ a^8+8 a^7\\ a^9+9 a^8\\a^{10}+10 a^9 \end{array}

so you know where to go for the first solution. As in the comment is suggested, substract the last row from each other, and then think about what permutations of indizes yields a non zero product. (this is much easier to see once you know what you shall see).

The second works nearly exactly the same, you only need to think in first a bit more. By knowing the first result the result for the second is most likely to be $$ \sum_{i=1}^n \underset{k\neq i}{\prod_{k=1}^n} a_k + \prod_{k=1}^n a_k$$

share|cite|improve this answer

The first determinant can (amongst other ways) be done by simply noting that adding $(a-1)I$ to a matrix shifts all eigenvalues by $a-1$, and noting that the eigenvalues of a matrix of all ones is simple to compute.

As Alexander suggests generally:

The operation of subtracting the last row from the others is the same as left-multiplying by

$\begin{pmatrix} 1 & 0 &\cdots & \cdots & 0 & -1 \\ 0 & 1 & 0 & & 0 & -1 \\ \vdots& 0 & \ddots &\ddots & \vdots& \vdots\\ & & \ddots& \ddots & 0& \vdots \\ \vdots & & & 0 & 1 & -1 \\ 0 & \cdots & & \cdots & 0 & \phantom{-}1 \end{pmatrix}$

which has determinant one, so such an operation does not affect the overall determinant. This adds many zeros, and should make your life a lot easier.

share|cite|improve this answer

this is only a half an answer, but unfortunately I do not have the credits for a comment.

The first determinant can be expressed in a nice closed form, see Circulant matrix

share|cite|improve this answer
How is this having an closed form something noteworthy at all? There are even ways to define the determinant via a closed form such that $$\det(A)=\sum_{\sigma \in S_n} (-1)^{\operatorname{signum} (\sigma)} \prod_{i=1}^n a_{i\sigma(i)}$$ – Dominic Michaelis Sep 7 '13 at 15:10
I think he/she is just saying that it fits the pattern of a circulant matrix. I agree that it is overkill. – Evan Sep 7 '13 at 15:14
@Dominic While true, the eigenvalues can also be expressed in a non-polynomial form, which makes that formula in this particular sense very useful. Also note that the amount of terms in the formula I mentioned is n^2, significantly reducing the n! terms in the one you mentioned. The website I linked also refers to further properties which the questioner may be interested in. – Not Buying It Sep 7 '13 at 15:15

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.