Integration trick $\int^{2\pi}_{0} f(a+ r \cos \theta, b+r\sin \theta)d\theta=2\pi f(a,b)$

Start by writing $f$ as a function of a complex variable in the usual way, so the claimed result is

$$\int_0^{2\pi} d\theta \,f\bigl(z_0+re^{i\theta}\bigr)=2\pi\,f(z_0)$$

with $z_0:=a+ib$. Expand the integrand as a Taylor series, viz.

$$\sum_{n\ge 0}\frac{f^{(n)}(z_0)}{n!}r^n\int_0^{2\pi} d\theta \,e^{in\theta}.$$

The required result follows from $\int_0^{2\pi} d\theta\, e^{in\theta}=2\pi\delta_{n0}$.


This follows from the Mean Value Theorem for harmonic functions. Let $f\in C^2(\Omega)$ be a harmonic function on some open domain $\Omega\subseteq\mathbb{R}^n$ then $$f(x_0)=\frac{1}{\text{vol}(B(x_0,r))}\int_{B(x_0,r)}f(x)\,dx=\frac{1}{\text{vol}(\partial B(x_0,r))}\int_{\partial B(x_0,r)}f(x)\,dS$$ for every ball $B(x_0,r)\subseteq \Omega$. Here $\partial B(x_0,r)$ is the sphere centered at $x_0$ with radius $r>0$ and $\,dS$ is the element of integration on $\partial B(x_0,r)$. Using the second formula for $n=2$ we obtain $$f(x_0)=\frac{1}{2\pi r}\int_{||x-x_0||\leqslant r}f(x)\,dS=\frac{1}{2\pi }\int_0^{2\pi}f(x_0+rw(\theta))\,d\theta$$ where $w(\theta):=(\cos(\theta),\sin(\theta))$. In particular for $x_0:=(a,b)$ you get the desired result.