## Appendix B Green's Function for the Helmholtz Equation  
The inhomogeneous scalar Helmholtz equation for a field \(\phi(\mathbf{r})\) and non-homogeneous source term \(h(\mathbf{r})\) is given by  
\[\left[-\
abla^{2}-k_{n}^{2}\right]\phi(\mathbf{r})=j(\mathbf{r}).\] (A16)  
The solution for this equation can be expressed in terms of the Helmholtz Green's function as  
\[\phi(\mathbf{r})=\phi_{0}(\mathbf{r})+\int_{\left\{\mathcal{V}_{g}(\mathbf{r} )\right\}}d^{3}\mathbf{r}^{\prime}g_{0}\left(\mathbf{r},\mathbf{r}^{\prime} \right)j(\mathbf{r}^{\prime}),\] (A17)where \(\phi_{0}(\mathbf{r})\) is a particular solution of the Helmholtz equation, \(\left[-\
abla^{2}-k_{n}^{2}\right]\phi_{0}(\mathbf{r})=0\), \(g_{0}\left(\mathbf{r},\mathbf{r}^{\prime}\right)\) is the retarded Helmholtz Green's function, which is given by Equation (5) (we have dropped the frequency argument), and \(\int_{\left\{V_{\delta}(\mathbf{r})\right\}}\) excludes an infinitesimal volume enclosing the point \(\mathbf{r}^{\prime}=\mathbf{r}\). The goal of this appendix is to prove that Equation (A17) with \(g_{0}\left(\mathbf{r},\mathbf{r}^{\prime}\right)\) given by Equation (5) is indeed a solution of the inhomogeneous Helmholtz equation. In order to do that we will first solve Equation (A16) by decomposing it in terms of Fourier components, allowing a simple derivation of \(g_{0}\left(\mathbf{r},\mathbf{r}^{\prime}\right)\). However, that derivation does not clarify how the integration in Equation (A17) should be performed. Therefore, we will also prove that Equation (A17) solves the inhomogeneous Helmholtz equation by direct substitution. Writing all the fields in Fourier components  
\[\phi(\mathbf{r})=\int\frac{d^{3}\mathbf{p}}{\left(2\pi\right)^{3}}e^{i \mathbf{p}\cdot\mathbf{r}}\phi(\mathbf{p}),\] (A18)  
and similarly for \(j(\mathbf{r})\), Equation (A16) becomes an algebraic equation with solution given by \(\phi(\mathbf{p})=g_{0}\left(\mathbf{p}\right)j(\mathbf{p})\), where  
\[g_{0}\left(\mathbf{p}\right)=\frac{1}{p^{2}-k_{n}^{2}}.\] (A19)  
is the Helmholtz Green's function in Fourier space. Inverting the Fourier transform, we can write  
\[\phi(\mathbf{r})=\int d^{3}\mathbf{r}^{\prime}g_{0}\left(\mathbf{r},\mathbf{ r}^{\prime}\right)j(\mathbf{r}^{\prime}),\] (A20)  
with [25,65]  
\[g_{0}\left(\mathbf{r},\mathbf{r}^{\prime}\right)=\int\frac{d^{3}\mathbf{p}}{ \left(2\pi\right)^{3}}\frac{e^{i\mathbf{p}\cdot\left(\mathbf{r}-\mathbf{r}^{ \prime}\right)}}{p^{2}-k_{n}^{2}}.\] (A21)  
In order to evaluate this integral we make the replacement \(k_{n}\to k_{n}+i0^{+}\)in order to obtain a retarded response function. The angular integration is easily performed and yields  
\[g_{0}\left(\mathbf{r},\mathbf{r}^{\prime}\right)=\frac{1}{2\pi\left|\mathbf{ r}-\mathbf{r}^{\prime}\right|}\int_{-\infty}^{+\infty}\frac{dp}{2\pi i}\frac{pe^{i \left|\mathbf{r}-\mathbf{r}^{\prime}\right|}}{p^{2}-\left(k_{n}+i0^{+}\right) ^{2}}.\] (A22)  
The remaining integration over \(p\) can be performed using contour integration techniques, by closing the contour on the upper complex half-plane and collecting the residue at \(p=k_{n}+i0^{+}\) and obtain Equation (5). Notice that in order to close the integral into the upper half-plane we must assume that \(\mathbf{r}-\mathbf{r}^{\prime}\
eq 0\). Next, we will prove by direct substitution that Equation (A17) with the Green's function given by the above equation solves the inhomogeneous Helmholtz equation (Equation (A16)). By doing so, we will check that the integration in Equation (A17) actually excludes the point \(\mathbf{r}=\mathbf{r}^{\prime}\). The crucial point in proving that Equation (A17) actually solves the inhomogeneous Helmholtz equation is to notice that the integration region over \(\mathbf{r}^{\prime}\) is actually a function of \(\mathbf{r}\).