Another good idea would be to take the value of \(f\) not only at one point, but as the average of the values at several points. An obvious choice would be to evaluate \(f\) at all four corners of each \(R_{ij}\) then average those. If we note that the lower left corner is \((x_{i},y_{j})\text{,}\) the upper left is \((x_{i},y_{j+1})\text{,}\) the lower right is \((x_{i+1},y_{i})\) and the upper right is \((x_{i+1},y_{i+1})\text{,}\) then the corresponding sum will be
\begin{equation*}
F_{mn}= \sum_{i,j=1,1}^{m,n}\frac{1}{4}\left( f(x_{i},y_{j}) + f(x_{i},y_{j+1}) + f(x_{i+1},y_{i}) + f(x_{i+1},y_{j+1}) \right) A_{ij}\text{,}
\end{equation*}
which we will call the four-corners method. If the subrectangles are evenly spaced, then we can simplify this expression. Notice that \(f(x_{i},y_{j})\) gets counted multiple times depending on where \((x_{i},y_{j})\) is located. For instance if \((x_{i},y_{j})\) is in the interior of \(R\) then it is the corner of \(4\) subrectangles. Thus the sum becomes
\begin{equation*}
F_{mn}= \frac{A}{4}\left( \sum_{\text{corners}}f(x_{i},y_{j}) + 2 \sum_{\text{edges}}f(x_{i},y_{j}) + 4 \sum_{\text{interior}}f(x_{i},y_{j}) \right)\text{,}
\end{equation*}
where \(A = \Delta x \, \Delta y\) is the area of the subrectangles. We can think of this as a weighted average of the values of \(f\) at the grid points \((x_{i},y_{j})\text{.}\) The weights used are represented in the matrix
\begin{equation}
W = \left( \begin{array}{cccccccc}1 & 2 & 2 & 2 & \cdots & 2 & 2 & 1 \\ 2 & 4 & 4 & 4 & \cdots & 4 & 4 & 2 \\ 2 & 4 & 4 & 4 & \cdots & 4 & 4 & 2 \\ \vdots & \vdots & \vdots & \vdots & \cdots & \vdots & \vdots & \vdots \\ 2 & 4 & 4 & 4 & \cdots & 4 & 4 & 2 \\ 1 & 2 & 2 & 2 & \cdots & 2 & 2 & 1 \\\end{array} \right)\text{.}\tag{3.7.1}
\end{equation}
We could implement the four-corner method by forming a matrix \((f_{ij})\) of \(f\) values at the grid points, then doing entry-wise multiplication of the matrix with the weight matrix. Then the integral would be obtained by summing all the entries of the resulting matrix and multiplying that by \(A/4\text{.}\) The formula would be
\begin{equation*}
F_{mn}= \frac{(b-a)(d-c)}{4mn}\sum_{i,j = 1,1}^{m+1,n+1}W_{ij}f(x_{i},y_{j})\text{.}
\end{equation*}
Notice that the four-corners method coincides with applying the trapezoid rule in each direction. Thus it is in fact a double trapezoidrule.