This is a continuation of this question: [A class of quadratic equations](https://mathoverflow.net/questions/234141/a-class-of-quadratic-equations)


Let $f(x,y) = ax^2 + bxy + cy^2$ be an irreducible and indefinite binary quadratic form. Consider the equation


$$\displaystyle f(x,y) = a,$$


where $a$ is the $x^2$ coefficient of $f$. Plainly, this equation is soluble in the integers since $(x,y) = (1,0)$ is a solution. Since $f$ is indefinite and irreducible, an appropriate action by the unit group of the quadratic field generated by $f$ will give us infinitely many solutions. 


I am interested in the case when one can find a solution with $y$ co-prime to $a$. This is not always possible. For example, the equation


$$\displaystyle 5x^2 - 7y^2 = 5$$


has fundamental solution $(6,5)$ and all solutions are of the form


$$\displaystyle \begin{pmatrix} 6 & 7 \\ 5 & 6 \end{pmatrix}^n \binom{\pm 6}{\pm 5}.$$


The issue appears to be that $a$ divides $b$, the $xy$ coefficient of $f$. However, this divisibility property is not preserved under substitution action by $\operatorname{GL}\_2(\mathbb{Z})$, so this cannot be an intrinsic obstruction. 


Here is the ultimate question I am interested in. Let $O\_f(\mathbb{R})$ be the maximal subgroup of $\operatorname{GL}\_2(\mathbb{R})$ which fixes $f$ by substitution. It is conjugate to the split orthogonal group $O(1,1)$. Let $O\_f^-$ denote the subset of $O\_f$ consisting of elements of negative determinant. This part is conjugate to 


$$\displaystyle \left \{ \pm \begin{pmatrix} \cosh t & \sinh t \\ -\sinh t & -\cosh t \end{pmatrix}, t \in \mathbb{R} \right \}.$$


My question is the following: for $f$ an irreducible and indefinite binary quadratic form with integer coefficients, does $O\_f^-$ always contain an element in $\operatorname{GL}\_2(\mathbb{Z})$? In other words, is $O\_f^- \cap \operatorname{GL}\_2(\mathbb{Z})$ always non-empty?


One can show that the $O\_f^-$ contains elements of the shape


$$\displaystyle \begin{pmatrix} m & \dfrac{bm + cn}{a} \\ n & - m \end{pmatrix},$$


where $(m,n)$ satisfies $f(m,n) = a$. If $n$ is co-prime to $a$, then since $am^2 + n(bm+cn) = a$, it follows that $n | bm + cn$ and the above is in $\operatorname{GL}\_2(\mathbb{Z})$. If $a | n$ and $a | b$, then again it is in $\operatorname{GL}\_2(\mathbb{Z})$.


I've done quite a few experiments and it seems that $O\_f^- \cap \operatorname{GL}\_2(\mathbb{Z})$ is always non-empty. 


Any help would be appreciated!



On certain solutions of a quadratic form equation
Your ultimate question was answered by Gauss: $O\_f^- \cap \operatorname{GL}\_2(\mathbb{Z})$ is nonempty if and only if the class of $f$ is ambiguous (i.e. its square is the trivial class).


Indeed, $f(x,y)$ is improperly equivalent to itself if and only if $f(x,y)$ is properly equivalent to $f(y,x)$. As the classes of $f(x,y)$ and $f(y,x)$ are inverses to each other, the claim follows. For more details see Theorem 2.1 in Chapter 14 of Cassels: Rational quadratic forms.


Sections 4 and 6 of the mentioned chapter contain further information on ambiguous classes, e.g. each such class contains a form of type $[A,0,C]$ or $[A,A,C]$, and vice versa.


