<s>[INST] Positive integer $2\times 2$ matrix with two positive integer square root matrices So suppose I have this matrix:
$$M=\begin{pmatrix}a & b \\ c & d \end{pmatrix}$$
I am sure that every entry is a positive integer. I am trying to figure out if it has 2 square roots in which every entry is also a positive integer. I took a look at http://en.wikipedia.org/wiki/Square_root_of_a_2_by_2_matrix . It basically says that, setting $s = \pm \sqrt{\det M}$ and $t = \pm \sqrt{a + d + 2s}$ you get that the square roots of $M$ are all of the form $$R = \frac{1}{t} \begin{pmatrix}a+s & b \\ c & d+s\end{pmatrix}$$
So, in order for every entry of $R$ to be a positive integer, am I correct in thinking $\det{M}$ must be a perfect square, $a + d \gt 2s$, $a>s$, $d>s$, $t>0$, t is an integer, and all enteries must be divisible by t? Or are there wholes in these conditions?
 [/INST] The Wikipedia article is not very clearly written. Let us derive the result by ourselves. Suppose
$$
M=\begin{pmatrix}A&B\\C&D\end{pmatrix}
=R^2={\underbrace{\begin{pmatrix}a&b\\c&d\end{pmatrix}}_{R}}^2
=\begin{pmatrix}a^2+bc&b(a+d)\\c(a+d)&bc+d^2\end{pmatrix}.
$$
Then $A+D+2(\det R) = (a+d)^2$ and
$$
\begin{pmatrix}A+\det R&B\\C&D+\det R\end{pmatrix}
=(a+d)\begin{pmatrix}a&b\\c&d\end{pmatrix}.
$$
Therefore, if $A+D+2\delta\neq0$ for some $\delta\in\{-\sqrt{\det M},\sqrt{\det M}\}$, then
$$
\begin{pmatrix}a&b\\c&d\end{pmatrix}
=\frac{1}{\pm\sqrt{A+D+2\delta}}
\begin{pmatrix}A+\delta&B\\C&D+\delta\end{pmatrix}\tag{1}
$$
is a (perhaps complex) square root of $M$. Also, if $A+D+2\delta\neq0$ for both $\delta=-\sqrt{\det M}$ and $\delta=\sqrt{\det M}$, then all square roots of $M$ are given by $(1)$.
When $A+D+2\delta=0$ for some $\delta\in\{-\sqrt{\det M},\sqrt{\det M}\}$, $M$ can have other square roots that do not take the form of $(1)$. For instance, as pointed out by Samuel, the identity matrix has infinitely many square roots: apart from $\pm I$, there are also square roots of the form
$$
\begin{pmatrix}a&b\\c&-a\end{pmatrix}
$$
where $a\in\mathbb{C}$ is arbitrary and $bc=1-a^2$. (Putting $a=0$ and $b=c=1$ gives the well known one; my favourite one is obtained by taking $a=b=1$ and $c=0$.)

Now, go back to your question. If $M=R^2$ for some positive integer matrix $R$, then $\det M=(\det R)^2$ must be a perfect square.
Also, we have
$$A+D+2\sqrt{\det M}>A+D-2\sqrt{\det M}> A+D-2\sqrt{AD}=(\sqrt{A}-\sqrt{D})^2 \ge0.$$
Therefore, every positive square root matrix of $M$, if any, takes the form of $(1)$.
It follows that for each $\delta\in\{-\sqrt{\det M},\sqrt{\det M}\}$ that produces an integer square root matrix from $(1)$, $\sqrt{A+D+2\delta}$ must be an integer that divides $A+\delta,\,B,\,C,\,D+\delta$. Note that it may not divide $A$ or $D$ (so your claim that it divides all entries of $M$ is false). For a counterexample, consider
$$
M=\begin{pmatrix}2&5\\5&17\end{pmatrix}
=\begin{pmatrix}1&1\\1&4\end{pmatrix}^2,\ \sqrt{\det M}=3.
$$
We have $\sqrt{A+D+2\sqrt{\det M}}=5$ divides $A+3=B=C=5$ and $D+3=20$, but not $A=2$ or $D=17$. This counterexample also shows that the condition $A>\sqrt{\det M}$ does not necessarily hold. By permuting the rows and columns of $M$, it follows that the condition $D>\sqrt{\det M}$ also is not necessarily true.
</s>