Product of two integers of the form $x^2+my^2$ is of the same form. Let $x,y,a,b\in \mathbb Z$. Prove that there are integers $c$ and $d$
so that
\begin{equation*}
(x^2+y^2m)(a^2+b^2m)=c^2+d^2m.
\end{equation*}
I'm stuck, I took the product and got $x^2a^2+b^2y^2m^2+(a^2y^2+x^2b^2)m$ but the numbers in the parenthesis need not be squares. Thank you in advance.

Try the following 
$$\begin{align}(ax+mby)^2+m(ay-bx)^2
&=a^2x^2+2maxby+m^2b^2y^2+ma^2y^2-2maxby+mb^2x^2\\
&=(a^2+mb^2)(x^2+my^2)\end{align}$$
The easy way to remember it is the identity with $m=1$
$$(a^2+b^2)(c^2+d^2)=(ac+bd)^2+(ad-bc)^2$$
