This book, which needs to be returned quite soon, has a problem I don't know where to start. How do I find a 4 parameter solution to the equation
$x^2+axy+by^2=u^2+auv+bv^2$
The title of the section this problem comes from is entitled (as this question is titled) "Numbers of the Form $x^2+axy+by^2$", yet it deals almost exclusively with numbers of the form $x^2+y^2$. It looks like almost an afterthought or a preview of what's to come where it gives the formula
$(m^2+amn+bn^2)(p^2+apq+bq^2)=r^2+ars+bs^2,r=mp-bnq,s=np+mq+anq$
Then 6 of the 7 problems use this form. The first few involve solving the form $z^k=x^2+axy+by^2$, which I quickly figured out are solved by letting $z=u^2+auv+bv^2$, then using the above formula to get higher powers. So for $z^2$ for example, I set $m=p=u$ and $n=q=v$ to get $x$ and $y$ in terms of $u$ and $v$. But for this problem, I'm drawing a blank.
Oh, well. This is from page 57 of Binary Quadratic Forms by Duncan A. Buell. As long as $$ \gcd(a_1, a_2, B) = 1 $$ we have $$ (a_1 x_1^2 + B x_1 y_1 + a_2 C y_1^2) (a_2 x_2^2 + B x_2 y_2 + a_1 C y_2^2) = a_1 a_2 X^2 + B X Y + C Y^2, $$ where we take $$ X = x_1 x_2 - C y_1 y_1, \; \; \; \; Y = a_1 x_1 y_2 + a_2 x_2 y_1 + B y_1 y_2. $$ This is Dirichlet's "united forms" recipe for composition, with $$ \langle a_1,B, a_2 C \rangle \; \langle a_2,B, a_1 C \rangle \; = \; \langle a_1 a_2,B, C \rangle $$ in the form class group. At least, it is a group when $$ B^2 - 4 a_1 a_2 C $$ is not a square.
So a four parameter identity with parameters $x_1, y_1, x_2, y_2$ would be $$ (a_1 x_1^2 + B x_1 y_1 + a_2 C y_1^2) (a_2 x_2^2 + B x_2 y_2 + a_1 C y_2^2) = a_1 a_2 (x_1 x_2 - C y_1 y_1)^2 + B(x_1 x_2 - C y_1 y_1)(a_1 x_1 y_2 + a_2 x_2 y_1 + B y_1 y_2) + C (a_1 x_1 y_2 + a_2 x_2 y_1 + B y_1 y_2)^2. $$