I am reading this paper about quantization of the electromagnetic field, and there is a point where the author imposes the fundamental commutation relation between the vector potential and its canonical momentum: $$[A_i(\mathbf r,t), p_i(\mathbf r',t)] = \frac{i\hbar}{4V}\sum_{\mathbf k}{(2e^{i\mathbf k\cdot(\mathbf r-\mathbf r')} + 2e^{-i\mathbf k\cdot(\mathbf r-\mathbf r')})} = i\hbar \delta(\mathbf r-\mathbf r')$$ I could follow how the sum is derived. But not why this is a delta function.
The author makes a remark that this is a finite volume. I suppose that this delta function is then defined so that: $$\int_V\delta(\mathbf r-\mathbf r')d^3r' = 1.$$
Considering that this volume is a period, the meaning would be: $\int_V e^{i\mathbf k\cdot(\mathbf r-\mathbf r')} = 0$ for $\mathbf r\neq\mathbf r'$ for all $k$'s. But the problem is that for $\mathbf r = \mathbf r'$, $$\frac{i\hbar}{4V}\sum_{\mathbf k}{(2e^{i\mathbf k\cdot(\mathbf r-\mathbf r')} + 2e^{-i\mathbf k\cdot(\mathbf r-\mathbf r')})} = \frac{i\hbar}{V}\sum_{\mathbf k}cos(\mathbf k\cdot \mathbf 0)\implies $$
$$\int_V\sum_{\mathbf k}cos(\mathbf k\cdot \mathbf 0)d^3r' = V(1 + 1 + 1 +...) = \infty$$ instead of $V$ as required.