# What's wrong in my calculation of $\int_0^{3 \pi/4} \frac{\cos x}{1 + \cos x}dx$?

What's wrong in my calculation of $$\int_0^{3 \pi/4} \dfrac{\cos x}{1 + \cos x} dx\,?$$

I have to find:

$$\displaystyle\int_0^{3 \pi/4} \dfrac{\cos x}{1 + \cos x} dx$$

and I can't seem to get the right answer. This is what I did:

I decided to use the Weierstrass substitution with:

$$t = \tan \dfrac{x}{2}$$

$$\cos x = \dfrac{1 - t^2}{1 + t^2}$$

$$\sin x = \dfrac{2t}{1 + t^2}$$

$$dx = \dfrac{2}{1+ t^2}$$

I am pretty new to this type of substitution.

Anyway, the boundaries become:

$$t_1= \tan 0 = 0$$

$$t_2 = \tan \dfrac{3 \pi }{8}$$ We have

$$\displaystyle\int_0^{3 \pi/4} \dfrac{\cos x}{1 + \cos x} dx =$$ $$=\displaystyle\int_0^{\tan 3 \pi/8} \dfrac{\dfrac{1 - t^2}{1 + t^2}}{1 + \dfrac{1 - t^2}{1 + t^2}} \cdot \dfrac{2}{1 + t^2}$$ $$=\displaystyle\int_0^{\tan 3 \pi/8} \dfrac{1-t^2}{1+t^2} dt$$

$$=\displaystyle\int_0^{\tan 3 \pi/8} \dfrac{1}{1+t^2}dt - \displaystyle\int_0^{\tan 3 \pi/8} \dfrac{t^2}{1+t^2} dt$$ $$=\displaystyle\int_0^{\tan 3 \pi/8} \dfrac{1}{1+t^2} dt - \displaystyle\int_0^{\tan 3 \pi/8} \dfrac{t^2 + 1 - 1}{1+t^2} dt$$

$$= \displaystyle\int_0^{\tan 3 \pi/8} \dfrac{1}{1+t^2} dt - \displaystyle\int_0^{\tan 3 \pi/8} 1 dt + \displaystyle\int_0^{\tan 3 \pi/8} \dfrac{1}{1+t^2} dt$$

$$= 2 \bigg [\arctan(t) \bigg ]_0^{\tan 3\pi/8} - \bigg [ t \bigg ]_0^{\tan 3\pi/8}$$

$$= 2\arctan \bigg ( \tan \dfrac{3 \pi}{8} \bigg ) - \tan \dfrac{3\pi}{8}$$

$$= 2 \dfrac{3 \pi}{8} - \tan \dfrac{3 \pi}{8}$$

$$=\dfrac{3 \pi}{4} - \tan \dfrac{3 \pi}{8}$$

So that's the answer that I got. However, my textbook claims that the correct answer is in fact $$\dfrac{\pi}{4} + \tan \dfrac{3 \pi}{8} - 2$$. So, what did I do wrong?

• WolframAlpha agrees with you. Dec 28 '19 at 1:50
• I think your textbook is definitely wrong about your exercise.
– user718578
Dec 28 '19 at 18:54

It's easier to write $$\frac{\cos x}{1+\cos x}=1-\frac{1}{1+\cos x}\cdot\color{red}{\frac{1-\cos x}{1-\cos x}}=1-\frac{1-\cos x}{\sin^2x}=1-\csc^2 x+\frac{\cos x}{\sin^2x}$$

So

$$\int\frac{\cos x}{1+\cos x}dx=x+\cot x-\csc x+C$$

or we can use $$1+\cos x=2\cos^2(x/2)\Longrightarrow \frac1{1+\cos x}=\frac12\sec^2(x/2)$$

So $$\int\frac1{1+\cos x}dx=\tan(x/2)+C$$

• Yeah! Further $$\cot x - \csc x = \frac{\cos x -1}{\sin x} = -\frac{2\sin^2\frac x2}{2\sin\frac x2 \cos \frac x2} = -\tan\frac x2$$
– Ak.
Dec 28 '19 at 2:07
• nice manipulation. Dec 28 '19 at 2:08
• @AliShather That's awesome, but from what I calculated using your answer, I still don't get the result that my textbook claims to be the right result. So what do I do? Is the textbook wrong?
– user592938
Dec 28 '19 at 18:34
• @user1502 your answer is right but the answer from your textbook is not. You can verify answers on wolfram. Dec 28 '19 at 19:07

Here is the step-by-step solution for the indefinite integral: