We will freely use the properties of the Jacobi symbol as stated in this question
In particular, we have the folowing:
If $m \equiv 1$ (mod $4$), $\left(\frac{m}{n}\right) = \left(\frac{n}{m}\right)$.
If $m \equiv 3$ (mod $4$) and $n \equiv 3$ (mod $4$), $\left(\frac{m}{n}\right) = -\left(\frac{n}{m}\right)$.
If $m \equiv 1$ (mod $4$), $\left(\frac{-1}{m}\right) = 1$.
If $m \equiv 3$ (mod $4$), $\left(\frac{-1}{m}\right) = -1$.
Case 1 $D \gt 0$ and $D \equiv 0$ (mod $4$)
$\chi([-1]) = \chi([D - 1]) = \left(\frac{D}{D-1}\right) = \left(\frac{D-1 +1 }{D-1}\right)
= \left(\frac{1}{D-1}\right) = 1$
Case 2 $D \gt 0$ and $D \equiv 1$ (mod $4$)
$\chi([-1]) = \chi([2D - 1]) = \left(\frac{D}{2D-1}\right) = \left(\frac{2D-1}{D}\right)
= \left(\frac{-1}{D}\right) = 1$
Case 3 $D \lt 0$ and $D \equiv 0$ (mod $4$)
We first note that $-D - 1 \equiv -1$ (mod $4$).
$\chi([-1]) = \chi([-D - 1]) = \left(\frac{D}{-D-1}\right) = \left(\frac{-(-D-1) -1 }{-D-1}\right)
= \left(\frac{-1}{-D-1}\right) = -1$
Case 4 $D \lt 0$ and $D \equiv 1$ (mod $4$)
We first note that $-2D -1 \equiv 1$ (mod $4$).
$\chi([-1]) = \chi([-2D - 1]) = \left(\frac{D}{-2D-1}\right) = \left(\frac{-1}{-2D-1}\right)\left(\frac{-D}{-2D-1}\right) = \left(\frac{-2D - 1}{-D}\right) = \left(\frac{-1}{-D}\right) = -1$.
[It’s also perfectly fine to ask and answer your own question, as long as you pretend you’re on Jeopardy! — phrase it in the form of a question. To be crystal clear, it is not merely OK to ask and answer your own question, it is explicitly encouraged.]
http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/ – Makoto Kato Nov 07 '13 at 00:27