# Is there a general method to solve diophantine equations of the form $x^2+Ay=C$

For example

$$x^2+7y=9$$I'm thinking something maybe along the lines of Pell's equation but not sure. Any help appreciated, been several years since I've last dealt with Pell equations and quadratic recipriocity.

We have $$-7y=x^2-9=(x+3)(x-3)$$ Hence we need either $x+3$ to be a multiple of $7$, or $x-3$ to be a multiple of $7$. Thus $x\equiv \pm 3\pmod{7}$. Any such $x$ will work, with $y$ specified uniquely given $x$.
More generally, if $C$ is a square modulo $A$, i.e. $C\equiv D^2\pmod{A}$ for some $D\in\mathbb{Z}$, then for some $k\in\mathbb{Z}$ we have $C=D^2+kA$ and hence $$x^2+Ay=D^2+kA$$ which we rewrite as $$A(k-y)=(x-D)(x+D)$$ Now we need $A$ to divide $(x-D)(x+D)$. If $A$ is prime, it must divide one or the other, but if $A$ is composite it might partly divide each. Once $x$ is chosen so that $A|(x-D)(x+D)$, $y$ is determined uniquely. In particular, solutions will always exist, by taking $x\equiv \pm D\pmod{A}$ (but other $x$'s might work too).
If $C$ is not a square modulo $A$ I dunno.