Integration using mean value theorem of $\int_0^{2\pi} \frac{2+\cos\phi}{5+4\cos\phi}\,\mathrm{d}\phi=\pi$ I am going through some worksheets to study for an exam and one question is to use the mean value theorem:
$$u(a)=\frac{1}{V_r}\int_{B_r(a)}u$$
with a suitable harmonic function to show that:
$$
\int_0^{2\pi} \frac{2+\cos\phi}{5+4\cos\phi}\,\mathrm{d}\phi=\pi
$$
How do I begin?
 A: We can try Poisson kernel.
$$
P_r(\theta)=\frac{1-r^2}{1-2r\cos\theta+r^2} = \Re \left(\frac{1+re^{i\theta}}{1-re^{i\theta}}\right).
$$
To have $\cos \theta$ on the numerator, we use $1+P_r(\theta)$. Then
$$
1+P_r(\theta) = \frac{2-2r\cos\theta}{1-2r\cos\theta+r^2} = 1+\Re \left(\frac{1+re^{i\theta}}{1-re^{i\theta}}\right).
$$
Put $r=1/2$, we have
$$
1+P_{1/2}(\theta) = \frac{8-4\cos\theta}{5-4\cos\theta}.$$
Then we use $\theta+\pi$ in place of $\theta$.
$$
1+P_{1/2}(\theta+\pi)=\frac{8+4\cos\theta}{5+4\cos\theta} = 1+\Re \left(\frac{1-\frac12 e^{i\theta}}{1+\frac 12e^{i\theta}}\right).
$$
Use $f(z) = 1+\frac{1-z/2}{1+z/2}$ on the neighborhood of the closed unit disk $\overline{\mathbb{D}}$, then we have by the Mean Value Theorem for $u(z)= \Re(f(z))$,
$$
\frac1{2\pi} \int_0^{2\pi} \frac{8+4\cos\theta}{5+4\cos\theta} d\theta 
=u(0) = 2.$$
The result follows by dividing both sides by $4$.
A: The Poisson kernels or harmonic functions are certainly useful, but here is a direct way to solve the problem: Letting $z=e^{i\phi},$ one has $$dz=iz~d\phi,\cos\phi=\frac{e^{i\phi}+e^{-i\phi}}2=\frac {z+z^{-1}}2.$$ By substitution, the original integral becomes $$\int_{|z|=1}\frac {2+\frac{z+z^{-1}}2}{5+4\cdot \frac{z+z^{-1}}2}\cdot \frac 1{iz}dz$$
$$=\int_{|z|=1}\frac {z^2+4z+1}{4iz(z+\frac 1 2)(z+2)}~dz=2\pi i\left(\frac 1 {4i}+\frac 1{4i}\right)=\pi$$ by the residue thereom, where the residues are evaluated at the poles $z=0$ and $z=-\frac 1 2.$
