probably Lagrange or Legendre, Pell variant

Evidently Legendre showed that, for positive primes, if $p \equiv 3 \pmod 8$ there is an integral solution to $x^2 - p y^2 = -2.$ Next, if $q \equiv 7 \pmod 8$ there is an integral solution to $x^2 -q y^2 = 2.$

What I would like, and seems to be true, is $x^2 - 2 p y^2 = -2$ for $p \equiv 3 \pmod 8,$ and $x^2 - 2 q y^2 = 2$ for $q \equiv 7 \pmod 8.$ It is probably in Mordell's book, which I do not have here.

Mordell does $x^2 - r y^2 = -1$ for any prime $r \equiv 1 \pmod 4,$ I do remember that. Anyway, I am writing up something and this issue came up.

P.S. Note these are the same as $2x^2 - p y^2 = -1$ if $p \equiv 3 \pmod 8,$ while if $q \equiv 7 \pmod 8$ there is $2x^2 -q y^2 = 1.$

-
Dirichlet generalized Legendre's technique to composite values of m in $x^2 - my^2 = d$; whether he actually treated the cases you are interested in is irrelevant since the method of proof can be transferred easily. I might have given a few references in my papers on descent on Pell conics. – Franz Lemmermeyer Jul 2 '12 at 18:49
@Franz thanks. I looked at some of your homework solution pdfs and did not see this. I will look at the Pell conics items. – Will Jagy Jul 2 '12 at 19:01

According to Dickson (History of numbers Vol. 2, Ch. XII, p.376), Göpel (Jour. für Math. 45, 1853, 1-14) proved your conjectures "by use of continued fractions".

Actually Jour. für Math. stands for Crelle's journal, and Göpel's paper (which is his 1835 doctoral dissertation) is available online here.

-
Thanks. I have Dickson's history at home, I did not think to check there. Also, this means Dickson was definitely aware of this when he wrote the book Studies in 1930. I did not find the indefinite ternary quadratic form I wanted in the tables on pages 150-151, then I realized that it would all work out if the binary forms I mentioned behaved as Gopel proved. Here we go, Crelle's is nowadays Journal für die reine und angewandte Mathematik. Very good. – Will Jagy Jul 2 '12 at 21:37
It's in Latin. Wow. – Will Jagy Jul 2 '12 at 21:40
I tried to find a more readable account, but no luck. It also took me a bit of time to realize that "Jour. für Math." meant "Journal für die reine und angewandte Mathematik". I think the title of the journal never changed, "Crelle's journal" has always been folklore. – GH from MO Jul 2 '12 at 21:47
According to en.wikipedia.org/wiki/Adolph_Göpel, Gopel died in 1847, 34 years old, and "after his death some of his works were published in Crelle's Journal." More onformation about Gopel at www-history.mcs.st-andrews.ac.uk/Biographies/Gopel.html. If you go to Google Scholar and type in gopel quadratic you'll find a few papers that mention his work. I haven't checked to see whether any of them give his, or other, proofs of the results in question. – Gerry Myerson Jul 2 '12 at 23:26
In volume 3, page 19, Dickson gives a bit more detail, but he seems to be reporting on writing $p$ and $2p$ as $x^2 \pm 2 y^2.$ Anyway, continued fractions are fine by me, I am happy using "reduced" indefinite binary quadratic forms, and demonstrating equivalence by finding the cycle of neighboring forms. This is a disguise for continued fractions. So if $p \equiv 3 \pmod 8,$ then $p x^2 - 2 y^2 \equiv x^2 - 2 p y^2,$ and if $q \equiv 7 \pmod 8,$ then $2 x^2 - q y^2 \equiv x^2 - 2 q y^2.$ – Will Jagy Jul 2 '12 at 23:35