Diffraction pattern for a cosine crystal I have a 2D square crystal which has a continuous potential $U(\vec r)$. It stretches to infinity. I want to find the diffraction pattern for this crystal. The potential I use is $$U(\vec r )=U(x \hat x+ y \hat y)=2 U_0(\cos(q \; x)+\cos(q \; y)) = \\2 U_0 \cos(\vec q \cdot \vec r ).$$
Where $\vec q = q\hat x + q\hat y$.
This potential can be written in a more useful form,
$$U(\vec r )= \sum_{\vec G} U_{\vec G} e^{i \vec G \cdot \vec r }\;\;\;\;\;\;\;\;\;\;\;\;\;\tag{1}$$
The sum can be taken over $\vec G = \vec q_1, \vec q_2, \vec q_1 + \vec q_2$ and so on, i.e. $\vec G = \sum_{i=1,2,3,...} n_i \vec q_i$. In this case, $U_{\vec G} = U_{0} $ if $\vec G \in \{ \pm q \hat x,\pm q\hat y\} $ and $U_{\vec G} =0$ otherwise.
Using this, it is easy and well known how to find the diffraction pattern.
The amplitude that a photon with wavevector $\vec k$ scatters to $\vec k'$ due to the crystal is
$$F=F_{\Delta \vec k=\vec k' - \vec k}=\langle \vec k'|\hat U| \vec k \rangle \propto \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k)\cdot \vec r} U(\vec r)\\$$
Substituting in the $U(\vec r)$ from Eq.(1), we see that the integral is equal to
$$\int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k)\cdot \vec r} U(\vec r)\\=\sum_{\vec G}U_{\vec G} \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G)\cdot \vec r}\\
=\sum_{\vec G \in \{ \pm q \hat x,\pm q\hat y\}}U_{\vec G} \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G)\cdot \vec r} \;\;\;\;\;\;\;\;\; \tag{2}$$
In the last equality I used the fact that all but 4 of the $U_{\vec G}$ are $0$, so we only have to sum over the 4 relevant $\vec G$.
From Eq.(2) scattering only happens when F is nonzero, i.e. when the arguments in the exponential are 0. Thus,$$\Delta \vec k = \{ \pm q \hat x,\pm q\hat y\}$$
This result seems wrong. Considering a square lattice potential of just delta functions instead of cosines, we would have expected scattering equally at every reciprocal lattice site to infinity, $$\Delta \vec k = \vec G$$
Clearly, the potential I am using should have a similar result to the delta function potential. What is the correct diffraction pattern here, and what am I doing wrong?
 A: My following standard procedure of crystallography analysis verify your concerns. The form factor vanishes except for $\Delta \vec k$ be one of the $\vec G_1$'s.
Let's continue analyse your integral.
\begin{align}
F&=F_{\Delta \vec k=\vec k' - \vec k}\\
&=\langle \vec k'|\hat U| \vec k \rangle\\
& \propto \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k)\cdot \vec r} U(\vec r)\\
&=\sum_{\vec G}U_{\vec G} \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G)\cdot \vec r}\\
&=\sum_{\vec G_1 = \{ \pm q \hat x,\pm q\hat y\}}U_{\vec G_1} \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G_1)\cdot \vec r} \tag{1}
\end{align}
I build the unit cell by defining two basis vectors:
\begin{align}
\vec a_1 &= \frac{2\pi}{q} \hat x;\\
\vec a_2 &=\frac{2\pi}{q} \hat y.\\
\vec R(n_1,n_2) &= n_1 \, \vec a_1 + n_2 \,\vec a_2. 
\end{align}
and the reciproal lattice vector:
\begin{align}
\vec b_1 &= q \hat x;\\
\vec b_2 &= q \hat y.\\
\vec G(h,k) &= h \, \vec b_1 + k \,\vec b_2. 
\end{align}
Note that
$$  \vec R \cdot \vec G = \text{integer} \,\times\, 2\pi.$$
With these arrangements, we replace the position $\vec r$ with a coordination within the unit cell: $ \vec r = \vec R(n_1, n_2) + \vec\rho$, an re-write Eq.(1) as
\begin{align}
F &=\sum_{\vec G_1 = \{ \pm q \hat x,\pm q\hat y\}}U_{\vec G_1} \int_{\text{all space}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G_1)\cdot \vec r}\\
&=\sum_{\vec G_1 = \{ \pm q \hat x,\pm q\hat y\}}U_{\vec G_1}\sum_{\vec R(n_1, n_2)}\int_{\text{unit cell}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G_1)\cdot \left( \vec R + \vec \rho\right)} \\
&= \sum_{\vec R(n_1, n_2)} e^{-i(\Delta \vec k\cdot \vec R)}\,\,\sum_{\vec G_1 = \{ \pm q \hat x,\pm q\hat y\}}U_{\vec G_1}\int_{\text{unit cell}} d^3\vec r \;e^{-i(\Delta \vec k- \vec G_1)\cdot \vec \rho} \\
&= \sum_{\vec R(n_1, n_2)} e^{-i(\Delta \vec k\cdot \vec R)}\, f_1(\Delta\vec k).
\end{align}
The first exponential phase determines the Bragg's condition $$\Delta k = \vec G(h, k)\,\, \text{ for arbitrary integrers } \, h, k.$$
Finally examine the form factor for $\Delta k = \vec G(h, k) = h q \hat x+ k q \hat y$
\begin{align}
 f_1(\Delta \vec k)&= \sum_{\vec G_1}\int_{unit cell} d\vec\rho\,U_{\vec G_1} e^{-i(\Delta \vec k -\vec G_1)\cdot \vec \rho}\\
& = U_o \int_0^{2\pi/q} dx \int_0^{2\pi/q} dy e^{iq(h+1)x + i(k+1)y)}\\
& + U_o \int_0^{2\pi/q} dx \int_0^{2\pi/q} dy e^{iq(h-1)x + i(k-1)y)}\\ 
& + U_o \int_0^{2\pi/q} dx \int_0^{2\pi/q} dy e^{iq(h+1)x + i(k-1)y)}\\
& + U_o \int_0^{2\pi/q} dx \int_0^{2\pi/q} dy e^{iq(h-1)x + i(k+1)y)}\\
\end{align}
The form factor vanishes, except for $\Delta \vec k$ being one of $\vec G_1$'s.
