Can the jacobi symbol be used for the statement "n is represented by some quadratic form of discriminant d iff 4n is a square mod d" We've been using the above statement repeatedly in a number theory course, but to find all primes that are represented by a quadratic binary form of discriminant d, we've been using $$(\frac{d}{4p}) = 1$$ I don't see why this works because this employs the jacobi symbol, rather than legendre, so if $(\frac{d}{4p}) = 1$, $p$ might not be a square mod $4n$. Where is there a flaw in my reasoning?
 A: the traditional steps: we want to express $p$   with discriminant $d.$  We use notation $\langle a,b,c \rangle$ to mean the binary form $f(x,y) =a x^2 + b xy + c y^2,$   with discriminant $d = b^2 - 4 a c.$
When there is a solution $ \beta$   to $ \beta^2 \equiv d \pmod p,$ we may need to change one thing if $ \beta \neq d \pmod 2,$  with one odd and the other even. If there is disagreement, we replace $\beta$ by $ b = p - \beta $  so that  $b^2 \equiv d \pmod {4p}.$ Thus  $b^2 -d \equiv 0 \pmod {4p}.$ This means there is an integer $c$  such that $ b^2 - d = 4pc $  Finally, we have created the form  $$\langle p,b,c \rangle$$
of discriminant $d$  because $b^2 - 4pc = d$
Finally, for positive forms we find an equivalent "reduced"   form, call it $\langle u,v,w \rangle$ ;  the change of variables involved amounts to a nonsingular 2 by 2 matrix, it can be readily inverted, and the left column of the inverse matrix shows  how to represent $p$  by the reduced form  $\langle u,v,w \rangle$
The same things work for indefinite forms (but discriminant not a square)  but there is more to the reduction step.
My guess is that you are using your $p, 4d$  results, but probably without detailing Gauss reduction, or the Gauss-Lagrange reduction for indefinite forms.
