Is there a specific way to attack congruences with two variables? The reason I ask is because up until now, I had never encountered such a problem. While browsing tonight, I came across this challenge problem in one of my books:
Suppose that $(ab,p)=1$ and that $p>2$. Show that the number of solutions $(x,y)$ of the congruence $ax^2+by^2\equiv 1\pmod{p}$ is $p-\left(\frac{-ab}{p}\right)$.
After experimenting with it for a few hours, I've barely gotten anywhere. So far, I've only managed to break it into some cases. $(ab,p)=1$ implies $(a,p)=(b,p)=1$ and $\left(\frac{-ab}{p}\right)=\left(\frac{-1}{p}\right)\left(\frac{a}{p}\right)\left(\frac{b}{p}\right)$, so if $\left(\frac{a}{p}\right)=\left(\frac{b}{p}\right)=1$ or $-1$, then $\left(\frac{ab}{p}\right)=1$, so I want to show there are $p-(-1)^{(p-1)/2}$ solutions.
Similarly, if $\left(\frac{a}{p}\right)=1$ and $\left(\frac{b}{p}\right)=-1$, I need to show there are $p+(-1)^{(p-1)/2}$ solutions.
In the first case, $a$ and $b$ would both be quadratic residues modulo $p$, and hence $c^2\equiv a\pmod{p}$ and $d^2\equiv b\pmod{p}$ for some $c,d$. Then the original problem would come to $(cx)^2+(dy)^2\equiv 1\pmod{p}$, but I'm not sure a sum of squares is any better. Is there a slick solution to a problem like this?, I'm very puzzled over it.