Elliptic equation on square with periodic boundary values for the solution and it's partial derivatives Suppose that $\Omega=[0,1]^2$. I will say that a real valued function $u$ on $\Omega$ satisfies periodic boundary values if
$$u(x,0)=u(x,1), \;u(0,y)=u(1,y),\;\;\;\text{ for all }x,y\in[0,1].$$
Now let $f\in L^2(\Omega)$, and suppose that I want to look for a solution of the following problem
$$ \begin{cases}-\Delta u+u=f, \;\;\text{ on }\Omega=(0,1)^2,\\
u,\; u_x,\text{ and }u_y\text{ satisfy periodic boundary values.}\end{cases}$$
The question is how to show existence (if possible) of $u$.

My input to the problem: The weak formulation of the problem with test space taken to be $$X=\{v\in H^1(\Omega):\text{ $v$ satisfies periodic boundary values}\},$$
is the same as the $H^1_0$ formulation, ie
$$a(u,v):=\int_\Omega\nabla u\cdot \nabla v+\int_\Omega uv =\int_\Omega fv=: F(v),\;\;\;\text{ for all }v\in X.$$
This is because the boundary integral vanishes due to $u_x$, $u_y$ and $v$ being in $X$. On the other hand, $X$ is a closed subspace of $H^1(\Omega)$ and therefore it is a Hilbert space with the $\|\cdot\|_{H^1}$ norm. I think we can use the Lax-Milgram theorem on $X$, because $a$ seems coercive on $X$, $a$ and $F$ are continuous on $X$.
However, the Lax-Milgram theorem gives uniqueness, which is weird because unlike $H^1_0(\Omega)$, the space $X$ does not exactly  prescribe the boundary values (it just says that they are periodic). In any case, even if I do get the solution $u\in X$ and then by regularity $u\in X\cap H^2(\Omega)$, I should still show that $u_x$ and $u_y$ satisfy periodic boundary values, and this I don't know how to.
 A: You are using the wrong space, that's all. The correct space is
$$
X=\{u \in H^1_{\textrm{loc}}(\mathbb R^2): u(\cdot+n)=u(\cdot) \quad \forall n=(n_1,n_2)\in \mathbb Z^2\}.
$$
Then you apply Lax-Milgram and you are good to go. Look at
Asymptotic Analysis for Periodic Structures, by Bensoussan, Lions, Papanicolaou (1979) chapter 1, for example.

Answering your comment. $f$ is likewise extended periodically, namely $f$ is extended by zero into $f_0$, and then identified with $\sum_{n\in \mathbb Z^2} f_0(\cdot + n)$ which is periodic on $\mathbb R^2$ and $L^2_{\textrm{loc}} (\mathbb R^2)$.
Now, on say $(-2,2)^2$, $-\Delta u + u=f$ as a weak solution, and therefore interior regularity shows $u\in H^2((-\frac32,\frac32)^2)$. All in all, $u\in H^2_{\textrm{loc}} (\mathbb R^2)$.  Consequently, $\partial_x u \in X$, and $\partial_y u \in X$.
Incidentally, because all coefficients are constant, you can write write $u$ explicitely as a (double) Fourier series, its coefficients being that of $f$, divided  by $n_1^2+n_2^2+1$. It saves you the trouble of using Lax-Milgram.
