How do I find the determinant of a 4x4 matrix when the diagonal is made up of variables? Evaluate: $\det(A)$, where $A=
\begin{bmatrix}
a & 1 & 1 & 1 \\
1 & a & 1 & 1 \\
1 & 1 & a & 1 \\
1 & 1 & 1 & a\end{bmatrix}$

By adding appropriate multiples of row 4 to the other 3 rows, you can see that the determinant of your matrix is 
$$
\left| 
\begin{array}{cccc}
0 &1-a &1-a &1-a^2\\
0 & a-1 & 0 & 1-a\\
0 & 0 & a-1 & 1-a\\
1& 1 & 1 & a
\end{array}
\right|
$$
Then, using cofactor expansion along the first column, the determinant is
$$
-\left| 
\begin{array}{ccc}
1-a &1-a &1-a^2\\
a-1 & 0 & 1-a\\
0 & a-1 & 1-a\\
\end{array}
\right|
$$
Every entry of the matrix here is a multiple of $(1-a)$, so this determinant is
$$
-(1-a)^3\left| 
\begin{array}{ccc}
1 & 1 &1+a\\
-1 & 0 & 1\\
0 & -1 & 1\\
\end{array}
\right|
$$
Now you can use your favourite technique(s) for computing the determinant of a $3\times 3$ matrix.
