I'm trying to calculate the following determinant: $$\begin{vmatrix} a_0 & a_1 & a_2 & \dots & a_n \\ a_0 & x & a_2 & \dots & a_n \\ a_0 & a_1 & x & \dots & a_n \\ \dots & \dots & \dots & \dots & \dots \\ a_0 & a_1 & a_2 & \dots & x \end{vmatrix} = $$ $$ = \begin{vmatrix} a_0 & a_1 & a_2 & \dots & a_n \\ a_0 & a_1 & a_2 & \dots & a_n \\ a_0 & a_1 & a_2 & \dots & a_n \\ \dots & \dots & \dots & \dots & \dots \\ a_0 & a_1 & a_2 & \dots & a_n \end{vmatrix} + \begin{vmatrix} 0 & 0 & 0 & \dots & 0 \\ 0 & x - a_1 & 0 & \dots & 0 \\ 0 & 0 & x - a_2 & \dots & 0 \\ \dots & \dots & \dots & \dots & \dots \\ 0 & 0 & 0 & \dots & x-a_n \end{vmatrix} = 0 + 0 = 0 $$
Still, experimental results contradict, since for one example I get a non-zero determinant.
What am I doing wrong?
$\text{Det}(AB) = \text{Det}(A)\text{Det}(B)$, but in general, $\text{Det}(A+B)$ is not equal to $\text{Det}(A) +\text{Det}(B)$. It looks like you have used this wrong formula $\text{Det}(A+B) = \text{Det}(A) +\text{Det}(B)$ for your first equality.