# Finding $\frac{1}{2\pi}\int_{0}^{2\pi}\phi^\prime(x) dx$, where $\phi(x)=\arctan\frac{3\cos x}{4(\cos x+\sin x)}$. Why isn't it $\phi(2\pi)-\phi(0)$?

I'm tasked with the following problem:

Evaluate $$I_C=\frac{1}{2\pi}\int_{0}^{2\pi}\left(\frac{d}{d\theta}\phi(\theta)\right) d\theta,\quad\text{where}\; \phi(\theta)=\arctan\left[\frac{3\cos(\theta)}{4(\cos(\theta)+\sin(\theta))}\right]$$

Am I correct in assuming that this is simply $$\phi(2\pi)-\phi(0)$$? When I do that I get zero, but when I take the derivative, then evaluate the integral I get -1. How do I use the fundamental theorem of calculus to get the correct answer?

Hint: what happens at $$\theta =3\pi/4, 7\pi/4$$? See the graph if required.