how to solve $x^2 \equiv -1 \pmod{13}$ Knowing that $p$ is prime and if $p \equiv 1 \pmod 4$, then $\left(\left(\frac{p-1}{2}\right)!\right)^2 \equiv -1 \pmod p$; how do I solve $x^2 \equiv -1 \pmod{13}$?

Observe that $$p-r\equiv-r\pmod p$$
putting $r=1,2,\cdots,\frac{p-1}2$ and multiplying we get
  $$\prod_{\frac{p+1}2\le r\le p-1 }r\equiv(-1)^{\frac{p-1}2} \prod_{1\le s\le \frac{p-1}2 }s$$
$$\prod_{\frac{p+1}2\le r\le p-1 }r\equiv\prod_{1\le s\le \frac{p-1}2 }s\text{ as } \frac{p-1}2 \text{ is even}$$
Multiplying by $\displaystyle \prod_{1\le s\le \frac{p-1}2 }s\text{ as } \frac{p-1}2, $ we get 
$$\left(\prod_{1\le s\le \frac{p-1}2 }s\right)^2\equiv \prod_{1\le r\le p-1 }r=(p-1)!\equiv-1\pmod p$$ using Wilson's Theorem
But $\displaystyle \prod_{1\le s\le \frac{p-1}2 }s=\left(\frac{p-1}2\right)!$
