I would like to understand more about Gauss's composition law for binary quadratic forms, in particular solve for the constraints explicitly so that I can see at a basic algebra level what is going on. Unfortunately, I can see enough to guess my way to a solution, but cannot figure out how to solve it directly to see all the steps.
Given two binary quadratic forms $f_1, f_2$, we can (under some conditions?) find another binary quadratic form $f_3$ obtained from their "composition" $$ f_1(w,x)\ f_2(y,z) = f_3(X,Y) $$ where $$ \begin{aligned} f_1(w,x) &= A_1 w^2 + B_1 wx + C_1 x^2 \\ f_2(y,z) &= A_2 y^2 + B_2 yz + C_2 z^2 \\ f_3(X,Y) &= A_3 X^2 + B_3 XY + C_3 Y^2 \\ \begin{bmatrix}X \\ Y \end{bmatrix} &= \begin{bmatrix}a & b & c & d \\ e & f & g & h\end{bmatrix} \begin{bmatrix}wy \\ wz \\ xy \\ xz \end{bmatrix} \\ \end{aligned} $$ and all variables are integers.
Expanding out the equation and collecting like terms of $w,x,y,z$ gives nine constraints which can be arranged like so: $$ \begin{aligned} A_1\begin{bmatrix} A_2 \\ B_2 \\ C_2 \end{bmatrix} &= \begin{bmatrix} a^2 & a e & e^2 \\ 2 a b & (a f + b e) & 2 e f \\ b^2 & b f & f^2 \\ \end{bmatrix} \begin{bmatrix} A_3 \\ B_3 \\ C_3 \end{bmatrix} \\ B_1 \begin{bmatrix} A_2 \\ B_2 \\ C_2 \end{bmatrix} &= \begin{bmatrix} 2 a c &(a g + c e) &2 e g \\ 2 (a d + b c) & (a h + b g + c f + d e) & 2 (e h + f g) \\ 2 b d & (b h + d f) & 2 f h \\ \end{bmatrix} \begin{bmatrix} A_3 \\ B_3 \\ C_3 \end{bmatrix} \\ C_1 \begin{bmatrix} A_2 \\ B_2 \\ C_2 \end{bmatrix} &= \begin{bmatrix} c^2 & c g & g^2 \\ 2 c d & (d g + c h) & 2 g h \\ d^2 & d h & h^2 \\ \end{bmatrix} \begin{bmatrix} A_3 \\ B_3 \\ C_3 \end{bmatrix} \\ \end{aligned} $$
If I look at the determinants of those matrices, they are "suspiciously" factorizable and let me guess what would be "convenient" solutions for $A_1,B_1,C_1,A_2,B_2,C_2$ in terms of $a,b,c,d,e,f,g,h$. If I plug that guess in, it is now possible to solve for $A_3,B_3,C_3$ showing that the guess works. $$ \begin{aligned} A_1 &= a f - b e \\ B_1 &= a h - b g + c f - d e \\ C_1 &= c h - d g \\ A_2 &= a g - c e \\ B_2 &= a h + b g - c f - d e \\ C_2 &= b h - d f \\ A_3 &= f g - e h \\ B_3 &= a h - b g - c f + d e \\ C_3 &= b c - a d \\ \end{aligned} $$ Also, due to the symmetry of the constraints, it is possible to get related solutions by swapping some signs.
At this point I found that this matches the summary given in this answer
https://math.stackexchange.com/a/1948413/746701
And also looks like
https://en.wikipedia.org/wiki/Bhargava_cube
However, since I effectively guessed my way to the solution, I cannot exclude the possibility of other answers. For instance the above suggests all three forms have the same discriminant $$D = B_1^2 - 4 A_1 C_1 = B_2^2 - 4 A_2 C_2 = B_3^2 - 4 A_3 C_3$$ but it is my understanding that Gauss's initial ideas involved a more general composition law that allowed composition of forms with different discriminants. I guess this could be found from modifying my guessed solution to include extra factors at some points?
But I really just want to see how to get there without guessing. Since I was able to use linear algebra tools to guess my way to the answer, I assume someone more well versed in linear algebra can show how to solve it directly.
- How can we directly solve the 9 constraint equations to get a clear relationship of the variables $A_1,...,C_3$ in terms of $a,b,c,d,e,f,g,h$?
- At what point (if ever) do we finally use the fact that we're dealing with integers here? Maybe that is crucial to the steps I'm missing?