Find the determinant of a matrix definition Let $A$ be a matrix that is defined like this:
$$A_{ij}=\begin{cases}
\alpha,  & \text{if i=j} \\
\beta , & \text{if i $\ne$ j}
\end{cases}
$$
So I realized this matrix looks somehow like this
$$
        \begin{pmatrix}
        \alpha & \beta & \beta \\
        \beta & \alpha & \beta \\
        \beta & \beta & \alpha \\
        \end{pmatrix}
$$
I tried to manipulate the rows to get an upper triangular matrix but couldn't succeed, am I in the right direction... some help?:)
 A: these matrices are very close to the elementary matrices: perturbation of the identity matrix by a rank one matrix. the matrix in question can be written as the sum of a scalar matrix and a rank one matrix. that is 
$$A = (\alpha - \beta) I + \beta aa^T \mbox{ where } a = (1,1,\cdots, 1)^T.$$ the eigenvalues of $aa^T$ are $a^Ta = n, 0, 0, \cdots, 0$ and it follows that the eigenvalues of $A$ are $$\alpha + \beta n - \beta, \alpha-\beta, \alpha-\beta, \cdots, \alpha - \beta$$ the determinant of $A$ is the product of the eigenvalues, which is $$ det(A) = (\alpha - \beta)^{n-1}(\alpha + (n-1)\beta). $$ 
A: Look at 2x2.  You can find the det of that.
Now expand across the first row of the 3x3 version.  What happens?  Notice any pattern?  You should see the matrix from the 2x2 case showing up quite a bit.
now repeat on 4x4.  Similar pattern.  Can you find what the general pattern is?  The next step is proving it.  Given that we start with 2, then 3, then 4, that's a hint that induction should be the approach.
A: We know that each determinant should consist of $n!$ products of $n$ entries each if we have an $n\times n$ matrix. Considering each $\alpha$ on the diagonal, such an $\alpha$ is multiplied by the determinant of the $(n-1)\times(n-1)$ version of the matrix. So if we take the previous determinant, multiply it by $n\cdot \alpha$, and divide each term by the exponent of $\alpha$ in the given term and add enough times $\beta^n$ to have a total of $n!$ products we should be good:
$$
\begin{align}
n&=2&&&det&=\alpha^2-\beta^2\\
n&=3&&&first&=3\alpha(\alpha^2-\beta^2)\\
&&&&&=3\alpha^3-3\alpha\beta^2\\
&&&&&\sim\alpha^3-3\alpha\beta^2\\
&&&&det&=\alpha^3-3\alpha\beta^2+2\beta^3\\
n&=4&&&first&=4\alpha(\alpha^3-3\alpha\beta^2+2\beta^3)\\
&&&&&=4\alpha^4-12\alpha^2\beta^2+8\alpha\beta^3\\
&&&&&\sim\alpha^4-6\alpha^2\beta^2+8\alpha\beta^3-6\beta^4+3\beta^4\\
&&&&det&=\alpha^4-6\alpha^2\beta^2+8\alpha\beta^3-3\beta^4\\
\end{align}
$$
Note here that in $n=4$ I have subtracted six $\beta^4$ and added three to have 12 negative and 12 positive terms as a total. Remember that we should have $4!=24$ products of $\alpha$'s and $\beta$'s and half of them should be positive, the other half negative. I do not know about a formula for the general $n$ yet, but it may be easy to derive from this ...

The reason for dividing by the exponent of $\alpha$ is that if we have $\alpha^k\beta^{n-k}$ each such product is counted repeated $k$ times when we move through the diagonal and consider which products each $\alpha$ participates in. If $k$ of the $\alpha$'s are in it, it will be counted when consulting each of these $k$ of the $\alpha$'s so $k$ times too often ...

One has to be careful when continuing this. We have to use the $24$-product version of $det(A_4)$ to have the correct number of products in $det(A_5)$:
$$
\begin{align}
first&=5\alpha(\alpha^4-6\alpha^2\beta^2+8\alpha\beta^3-6\beta^4+3\beta^4)\\
&=5\alpha^5-30\alpha^3\beta^2+40\alpha^2\beta^3-30\alpha\beta^4+15\alpha\beta^4\\
&\sim \alpha^5-10\alpha^3\beta^2+20\alpha^2\beta^3-30\alpha\beta^4+15\alpha\beta^4-20\beta^5+24\beta^5\\
det(A_5)&=\alpha^5-10\alpha^3\beta^2+20\alpha^2\beta^3-15\alpha\beta^4-4\beta^5
\end{align}
$$
This result is confirmed by Wolfram Alpha. Note also how the second to last line above has 60 positive and 60 negative contributions. A total of $5!=120$ as desired.
A: Have you tried using the laplace format to get the determinant ?
+a(aa - bb) - b(ba - bb) + b(bb - ab) 
A: The Matrix Determinant Lemma gives the determinant of a generalization of this form of matrix, namely, of the sum of an invertible matrix $B$ and a rank-$1$ matrix, which we can always write as a product ${\bf u} {\bf v}^T$ for vectors ${\bf u}, {\bf v}$:
$$\det (B + {\bf u} {\bf v}^T) = (1 + {\bf v}^T B^{-1} {\bf u}) \det B . \qquad (\ast)$$
In our case, we can write the given $n \times n$ matrix $A$ as
$$B + {\bf u} {\bf v}^T,$$
where
$$      B = (\alpha - \beta) I_n, \qquad
  {\bf u} = \begin{pmatrix} 1 \\ \vdots \\ 1\end{pmatrix}, \qquad
  {\bf v} = \beta {\bf u}.$$
To evaluate $(\ast)$, we need that
$$\det B = \det[(\alpha - \beta) I_n] = (\alpha - \beta)^n$$
and
$$B^{-1} = (\alpha - \beta)^{-1} I_n,$$ which in particular gives
$${\bf v}^T B^{-1} {\bf u} = n \beta (\alpha - \beta)^{-1},$$
and substituting gives
$$\color{red}{\det A} = [1 + n \beta (\alpha - \beta)^{-1}] (\alpha - \beta)^n \color{red}{ = (\alpha - \beta)^{n - 1}[\alpha + (n - 1) \beta]}.$$
