Consider quadratic forms $\displaystyle f(x,y) = \alpha x^2 + \beta xy +\gamma y^2$ for discriminantsD. We define the (strict) class number $\displaystyle h(D)$ using matrices $\displaystyle M = \left( \begin{array}{ccc}

a & b \\

c & d \end{array} \right) \in SL_2(\mathbb{Z})$ so that $\displaystyle f'(x, y) \sim f(ax + by, cx + dy);$ then $\displaystyle h(D)$ is the number of equivalence classes under this equivalence relation.

Similarly, we define the (extended) class number $\displaystyle h_0(D)$ using matrices $\displaystyle M \in GL_2(\mathbb{Z})$ and using the equivalence relation $\displaystyle f'(x, y) \sim (det M)f(ax + by, cx + dy).$

a) Show that if $\displaystyle D < 0$, then $\displaystyle h(D) = h_0(D)$.

b) If $\displaystyle D > 0$, show that $\displaystyle h(D) = h_0(D)$ or $\displaystyle h(D) = 2h_0(D)$ according to whether or not the equation $\displaystyle t^2 - Du^2 = -4$ has a solution in integers.

I think I proved a), so Im needing help to prove b), but if you have a nice proof for a) I would also like to see it.

I hope someone can help me here.