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?

• Either let $\tan x=z$, or, if you want to work with familiar formulas, let $u=2x$ and then let $z=\tan(u/2)$. – André Nicolas Dec 22 '15 at 6:24
• I then get $\int \frac{4 dz}{2 - z^2}$ but, just like the answer below, I still don't understand how to get arctan. – totembowl Dec 22 '15 at 6:39
• A relatively easy way to check the result of the computation of a primitive is differentiation. Differentiate the purported solution and see whether you obtain the integrand. Of course do not forget to check the book's result (particularly not if your result has the correct derivative). While it's not necessarily immediately obvious that the derivative of the book's answer cannot be transformed into the integrand, if you look at the values at specific points, it becomes clear quickly: At $x = 0$, the book's answer has a negative derivative, but the integrand is positive there. – Daniel Fischer Dec 23 '15 at 9:47

Notice, the steps of substitution you showed are correct but your final answer is wrong. It shouldn't be in terms of $\arctan$

if you let $z=\tan \frac{x}{2}\implies dx=\frac{2\ dz}{1+z^2}$ then $$\int \frac{8\ dx}{3\cos 2x+1}$$ $$=\int \frac{8\ dx}{3(2\cos^2x-1)+1}=\int \frac{4\ dx}{3\cos^2x-1}$$

$$=\int \frac{4}{3\left(\frac{1-z^2}{1+z^2}\right)^2-1}\frac{2\ dz}{1+z^2}$$ $$=\int \frac{4}{3\left(\frac{1-z^2}{1+z^2}\right)^2-1}$$ $$=\int \frac{4(1+z^2)}{z^4-4z^2+1}\ dz$$ $$=4\int \frac{1+\frac{1}{z^2}}{\left(z-\frac 1z\right)^2-2}\ dz$$ $$=4\int \frac{d\left(z-\frac{1}{z}\right)}{\left(z-\frac 1z\right)^2-(\sqrt 2)^2}$$ $$=\frac{4}{2\sqrt 2}\ln\left|\frac{z-\frac{1}{z}-\sqrt 2}{z-\frac{1}{z}+\sqrt 2}\right|+C$$ substituting back $z=\tan \frac x2$, $$=\sqrt 2\ln \left|\frac{\tan\frac{x}{2}-\cot\frac{x}{2}-\sqrt 2}{\tan\frac{x}{2}-\cot\frac{x}{2}+\sqrt 2}\right|+C$$

• I double checked the answer in my book and it is correctly typed in my question. However, Wolfram|Alpha also seems to support there might be a typo in my book: wolframalpha.com/input/?i=integrate+8%2F%283cos2x%2B1%29 – totembowl Dec 22 '15 at 6:58
• I really like your factoring into $(z - \frac{1}{z})$ and your shorthand $d(z-\frac{1}{z})$; I have so much to learn. – totembowl Dec 22 '15 at 7:01
• Alright, it may be a typo. But the answer for the question you asked here is not correct that you gave, – Harish Chandra Rajpoot Dec 22 '15 at 7:02
• Notice, this problem can be solved more easily if you just substitute $\cos2x=\frac{1-\tan^2x}{1+\tan^2 x}$ – Harish Chandra Rajpoot Dec 22 '15 at 7:06
• I added a disclaimer at the top of my question about the likely typo in my book. Thanks for bringing to my attention. – totembowl Dec 22 '15 at 7:08

HINT:

$$\dfrac8{3\cos2x+1}=\dfrac{8\sec^2x}{3(1-\tan^2x)+1+\tan^2x}$$

Now set $\tan x=y$

• I then get $\frac{4(1+y^2)}{2-y^2}$ but I still don't understand how to get arctan which I would expect from an integral like $\int \frac{dy}{a^2 + y^2}$ for example. – totembowl Dec 22 '15 at 6:37
• @totembowl, You should get $$\int\dfrac{8dy}{4-2y^2}$$ – lab bhattacharjee Dec 22 '15 at 6:39
• I replaced $sec^2 x$ in the numerator with $(1 + \tan^2 x)$ and then $(1 + z^2)$, how did you simplify the numerator? – totembowl Dec 22 '15 at 6:41
• @totembowl $sec^2 x dx$ must be written as $dy$.Don't do what you did ^ – user220382 Dec 22 '15 at 6:48
• Thank you, I missed that $dy = \sec^2 x dx$. – totembowl Dec 22 '15 at 6:53

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.$$

• Did you miss a factor $2$ in $dx$ ? – Claude Leibovici Dec 22 '15 at 6:51
• @ClaudeLeibovici: The substitution I am making is not quite standard Weierstrass, it is $z=\tan x$. So $dz=(\sec^2 x)\,dx=(1+\tan^2 x) \,dx=(1+z^2)\,dx$. – André Nicolas Dec 22 '15 at 6:56
• Ooops ! Shame on me !!! – Claude Leibovici Dec 22 '15 at 7:00