I'm currently reading elementary number theory books, specifically in the chapter of binary quadratic forms. This problem got my attention.
Let $f(x,y)=ax^2+bxy+cy^2$ and $g(x,y)=rx^2$, where $r=gcd(a,b,c)$ and $f$ is a positive semidefinite quadratic form with discriminant $d=0$. Prove that $f$ is equivalent to $g$.
I know that $f$ can be expressed as $f(x,y)=r(hx+ky)^2$ since the dicriminant of $f$ is $d=0$. Then there exist integers $x_0$ and $y_0$ such that $f(x_0,y_0)=0$. Also $gcd(h,k)=1$ so there must be integers $u$ and $v$ with $hu+kv=1$. My guess is that the matrix $M=\begin{pmatrix}u&x_0\\v&y_0 \end{pmatrix}$ takes $f$ to $g$. Now, if $g(x,y)=Ax^2+Bxy+Cy^2$, then $A=f(u,v)=r$ and $C=f(x_0,y_0)=0$. But I'm not sure if this will make $B=0$ or if my assumption is right. Can someone help me to prove this? Thank you in advance.