If $a, b, c, d$ exists s.t. $p=a^2+kb^2$, $pn=c^2+kd^2$, proof that integer $x, y$ such that $n=x^2+ky^2$ exists. Question. $p$ is a prime, $k$ is a given natural number. If $a, b, c, d$ exists s.t. $p=a^2+kb^2$, $pn=c^2+kd^2$, proof that integer $x, y$ such that $n=x^2+ky^2$ exists.
My approach. Let $n=x^2+ky^2$.
$pn=(a^2+kb^2)(x^2+ky^2)=(ax \pm kby)^2+k(ay \mp bx)^2$.
Let $(x_1, y_1)$ the root of $ax+kby=c, -bx+ay=d$.
Let $(x_2, y_2)$ the root of $ax-kby=c, bx+ay=d$.
If one of $(x_1, y_1)$ or $(x_2, y_2)$ is integer pair, the proof will be done.
$$x_1=\frac{ac-kbd}{p}, y_1=\frac{ad+bc}{p}$$
$$x_2=\frac{ac+kbd}{p}, y_2=\frac{ad-bc}{p}$$
So when we proof these three,


*

*$p \mid (ad+bc)(ad-bc)$

*$p \mid ad+bc \Rightarrow p \mid ac-kbd$

*$p \mid ad-bc \Rightarrow p \mid ac+kbd$
The proof will be done.
How should I prove this?
 A: $(1)\ \ \ \ p^2n = (ac\mp kbd)^2+ k(ad\pm bc)^2\ $ by composing $\,p\times pn\,$ (or norm multiplicativity)
Note $\ \color{#c00}p\mid (ad\!+\!bc)(ad\!-\!bc) = (ad)^2\!-(bc)^2 = d^2\color{#c00}p - b^2\color{#c00}pn$
Thus $\,p\mid ad\!+\!bc\,$ or $\,p\mid ad\!-\!bc\,$ so by $(1)$ also $\,p\mid ac\!-\!kbd\,$ or $\,p\mid ac\!+\!kbd,\,$ which implies that  we can divide $\,(1)\,$ by $p^2$ to obtain the sought representation of $\,n$.
A: feb. 21 2019
LEMMA: with integers, if $v^2 | w^2,$ then $v | w.$
With $b \neq 0,$ since $p$ is a prime rather than a square,
$$ p = a^2 + k b^2 $$
$$  np = c^2 + k d^2 $$
$$ kb^2 = p - a^2 $$
$$ b^2 np = b^2 c^2 + (k b^2) d^2 = b^2 c^2 + (p-a^2)d^2 = (b^2 c^2 - a^2 d^2) + p d^2  $$
Thus
$$ p | (bc-ad)(bc+ad)  $$
and $p$ divides at least one of them. Define some
$$   \phi = \pm 1$$ so that
$$ p | bc - \phi ad. $$
We then have an integer $\tau$ with
$$ bc - \phi ad = p\tau, $$
$$ bc + \phi ad = p\tau + 2 \phi a d ,  $$
$$   (b^2 c^2 - a^2 d^2) = p^2 \tau^2 + 2 \phi adp\tau .  $$ Recall
$$ b^2 np =  (b^2 c^2 - a^2 d^2) + p d^2  $$
$$ b^2 np =  p^2 \tau^2 + 2 \phi adp\tau + p d^2  $$ Divide by $p$ and switch order
$$ b^2 n = d^2 + 2 \phi da\tau + p \tau^2 $$
Add and subtract $a^2 \tau^2, \;$
$$ b^2 n = (d^2 + 2 \phi da\tau + a^2 \tau^2) + (p \tau^2 - a^2 \tau^2) $$
$$  b^2 n = (d + \phi a \tau)^2 + \tau^2 (p-a^2) $$
Recall $p - a^2 = k b^2$
$$  b^2 n = (d + \phi a \tau)^2 + k b^2 \tau^2  $$
Now, $b^2 |  (d + \phi a \tau)^2,$ so the LEMMA says $b | d + \phi a \tau.$ We may introduce an integer $\psi$ with
$$  d + \phi a \tau = b \psi,   $$ whence
$$  (d + \phi a \tau)^2 = b^2 \psi^2.   $$ Then
$$ b^2 n = b^2 \psi^2 + k b^2 \tau^2,   $$ finally
$$  n = \psi^2 + k  \tau^2.   $$
