Integrating $\int \frac{8 dx}{3 \cos 2x + 1}$ to arctan rather than log [Edit: It is becoming increasingly likely that the expected answer containing arctan might be a typo from my book, which is transcribed correctly here, so an answer containing log might be correct after all. Sorry about that and thanks for the answers so far, I've learned a lot!]
I'm trying to integrate:
$$
\int \frac{8 dx}{3 \cos 2x + 1} \\
$$
So I tried substituting $x$ for $z$:
$$
z = \tan \frac{x}{2} \\
\cos x = \frac{1 - z^2}{1 + z^2} \\
dx = \frac{2 dz}{1 + z^2} \\
$$
Then I tried replacing $\cos 2x$ with $2 \cos^2 x - 1$ followed by some work:
$$
\int \frac{4(1 + z^2) dz}{z^4 - 4z^2 + 1} \\
$$
If I try substituting $z$ back to $x$, it seems my answer will contain log rather than the expected arctan:
$$
\frac{x}{3} - \frac{5}{6} \arctan (2 \tan \frac{x}{2}) + C \\
$$
Did I take a wrong turn somewhere?

If we are going to make a Weierstrass-style substitution, it seems more natural, because of the $\cos 2x$, to let $z=\tan x$. Then $\cos 2x=\frac{1-z^2}{1+z^2}$ and $dx=\frac{1}{1+z^2}\,dz$. Thus our integral becomes, after a little manipulation,
$$\int\frac{4}{2-z^2}\,dz.$$ 
