# General compatibility condition for pure Neumann problem

It is known than for a second order elliptic boundary-value problem with pure Neumann conditions, a certain compatibility condition between the data must be satisfied. For example, in the case of the Poisson equation with pure Neumann data: $$-\Delta u = f\quad\text{in }\Omega,$$ $$\frac{\partial u}{\partial \nu} = g\quad\text{on }\partial\Omega,$$ the following must hold: $$\int_\Omega f\,dx + \int_{\partial\Omega}g\,ds = 0.$$

My question is how we can generalise the compatibility condition for a general problem, i.e. $$-\sum_{i, k = 1}^{n} \partial_i(a_{ik}\partial_k u) + a_0u = f\quad \text{on }\Omega,$$ $$\sum_{i, k}\nu_i a_{ik} \partial_k u = h \quad \text{on } \partial\Omega.$$ where the differential operator given in divergence form is elliptic, and $$\nu_i$$ denotes the $$i$$-th component of the outward-pointing normal.

The compatibility condition comes from integrating the equation on both sides. In your case you have

$$-\text{div}(A\nabla u) + a_0 u = f.$$

Integrate both sides over $$\Omega$$ and integrate by parts (i.e., use the divergence theorem) to find that

$$-\int_{\partial \Omega} \nu \cdot A \nabla u \, dS + a_0 \int_\Omega u\, dx = \int_\Omega f\, dx.$$

The first term is exactly your boundary condition (with a negative sign), so we obtain

$$\int_\Omega f\, dx + \int_{\partial \Omega} h \, dS = a_0 \int_\Omega u\, dx.$$

When $$a_0\neq 0$$, this is not so much a compatibility condition as it is just a condition on the solution $$u$$. When $$a_0=0$$ it is the same compatibility condition as in your simple example.