I need to calculate the integral of $f(x,y)=(x+y)^2$ on the square $[0,1]\times [0,1]$ by using the definition of Riemann Sums. I know with Fubini that it has to be $\frac{7}{6} $ but in my solution I get $\frac{1}{2} $. Where is my mistake?
Let $z_k$ be a partition of $[0,1]\times[0,1]$ with $z_k=z_1 \times z_2$ and $z_1=\{0,1/k,2/k,...,1\}$ and $z_2=\{0,1/k,2/k,...,1\}$
$x_{ij} \in [(i-1)/k,i/k]\times[(j-1)/k,j/k]$ from wehre we choose $x_{ij}=(i/k,j/k)$
Then: \begin{align} S_{z_k}(f)&=\sum_{i,j=1}^k(i/k+j/k)^2\cdot1/k^2\\ &=1/k^4 (\sum_{i=1}^k i^2+2\sum_{i=1}^k \sum_{j=1}^kij+\sum_{j=1}^kj^2\\ &=1/k^4((1/3)(k(k+1)(2k+1)+(1/2)k^2(k+1)^2)\\ &=1/2+5/(3k)+3/(2k^2)+1/(3k^3) \rightarrow 1/2 \end{align} for $k$ to infinity.
Can someone help me?
Starting from your sum $S_{z_{k}}(f)$:
\begin{align} S_{z_{k}}(f) &= \sum_{i,j=1}^{k}(i/k+j/k)^{2}\times 1/k^{2} \tag{1}\\ &= \frac{1}{k^{4}}\left(\sum_{i,j=1}^{k}i^{2} + 2\sum_{i,j=1}^{k} ij + \sum_{i,j=1}^{k} j^{2}\right) \tag{2}\\ &= \frac{1}{k^{4}}\left( k \frac{k(k+1)(2k+1)}{6} +\frac{k^{2}(k+1)^{2}}{2}+k\frac{k(k+1)(2k+1)}{6}\right) \tag{3} \end{align}
After simplifying and letting $k\to \infty$: we obtain $$\frac{1}{3}+\frac{1}{2}+\frac{1}{3}=\frac{7}{6}.$$
To point out where your mistake is: You go from $(1)$ above to $$\frac{1}{k^{4}}\left(\sum_{i=1}^{k}i^{2} + 2\sum_{i,j=1}^{k}ij + \sum_{j=1}^{k} j^{2}\right)$$ which is incorrect because you are missing a summation over $j$ in the first term $"\sum_{i=1}^{k} i^{2}"$ and similarly you miss a summation over $i$ in the last term $"\sum_{j=1}^{k} j^{2}$" (compare with $(2)$). Leaving out these summations have the effect that when $k\to \infty$ neither of the aforementioned terms contribute to the end result.