Consider quadratic forms for discriminantsD. We define the (strict) class number using matrices so that then is the number of equivalence classes under this equivalence relation.

Similarly, we define the (extended) class number using matrices and using the equivalence relation

a) Show that if , then .

b) If , show that or according to whether or not the equation 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.