Calculus of Variations: Mul-variable-mul-function My question is: How to find the necessary condition for minimizing/maximizing the functional 
$$J(f,g)=\int\int_{R}F(x,y,f(x),g(y))dxdy,~~~~~~~~~~(1)$$
where we have two functions $f(x)$ which only depends on $x$ and $g(y)$ which only depends on $y$.
My derivations for the necessary conditon of (1) is summerized as follows:
\begin{equation}
\begin{split}
\Delta J=& \int\int_R F(x,y,f+\varepsilon\eta_1(x), g+\varepsilon\eta_2(y))-F(x,y,f,g) ~dxdy \\
=& \int\int_R \varepsilon\eta_1(x)\frac{\partial F}{\partial f} + \varepsilon\eta_2(y)\frac{\partial F}{\partial g}+ \cdots dxdy ~~~~(\text{Extend by Taylor's Theorem}) \\
\Longrightarrow \\
\delta J= & \varepsilon\int\int_R \eta_1(x)\frac{\partial F}{\partial f} + \eta_2(y)\frac{\partial F}{\partial g}~dxdy ~~~ (\text{Linear part of the increment}) \\
\delta J=0~&\Rightarrow  \frac{\partial F}{\partial f}=0 ~\text{and}~ \frac{\partial F}{\partial g}=0 ~~~(\text{Linear independence of $\eta_1(x)$ and $\eta_2(y)$})
\end{split}
\end{equation}
Can anyone point out what mistake I made or just solve (1) using calculus of variations? Any suggestion will be appreciated. Thanks in advance.
 A: The equation 
$$
\iint_R \left(\eta_1(x) \frac{\partial F}{\partial f}+ \eta_2(y) \frac{\partial F}{\partial g}\right)\,dx\,dy =0
\tag{EL}$$
is correct, but it does not imply that $\frac{\partial F}{\partial f}$ and $ \frac{\partial F}{\partial g}$ are identically zero. The correct conclusion is that 
$$\int  \frac{\partial F}{\partial f}(x,y)\,dy =0 \quad \forall x\tag3$$
$$\int  \frac{\partial F}{\partial g}(x,y)\,dx =0 \quad \forall y\tag4$$
First, it is easy to check that if (3) and (4) hold, then (EL) holds. Just multiply (3) by $\eta_1$ and integrate with respect to $x$. Similar with (4). 
And conversely: introducing $\phi(x)= \int  \frac{\partial F}{\partial f}(x,y)\,dy $ and $\psi(y) = \int  \frac{\partial F}{\partial g}(x,y)\,dx $, you can write (EL) as 
$$
\int \eta_1(x)\phi(x)\,dx + \int \eta_2(y) \psi(y)\,dy = 0  
$$
which implies $\phi\equiv 0$, $\psi\equiv 0$.
The main point  is that $\eta_1$ and $\eta_2$ can depend on one variable only. If they could be arbitrary functions of two variables, the conclusion in your post would be correct.
