<s>[INST] Smith Normal Form Would the Smith Normal Form of the following matrix over $\mathbb Q[x]$
$$\begin{pmatrix}
  (x+a)(x+b) & 0 & 0 &0 \\
 0 & (x+c)(x+d) & 0 & 0 \\
  0  &0 & x^3(x+a) & 0  \\
  0 & 0 & 0& x^2(x+b)
 \end{pmatrix}$$
 simply be
$$\begin{pmatrix}
  f(x) & 0 & 0 &0 \\
 0 & f(x) & 0 & 0 \\
  0  &0 & f(x) & 0  \\
  0 & 0 & 0& f(x)
 \end{pmatrix}$$
where $f(x)= x^3(x+a)(x+b)(x+c)(x+d)$?
I am not sure because that would make the question quite trivial.
 [/INST] No.
Let $s_k$ denote the $k$th entry on the diagonal of Smith form (i.e., the $k$th invariant factor). Then $$s_k = \frac{d_k}{d_{k-1}},$$ where $d_k = \gcd$ of all $k \times k$ minors of the original matrix (aka $k$th determinantal divisor). I'm assuming $a,b,c,d$ are distinct here. So the Smith form is:
$$
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0\\
0 & 0 & x^2(x+a)(x+b) & 0\\
0 & 0 & 0 & x^3(x+a)(x+b)(x+c)(x+d)
\end{pmatrix}
$$
</s>