What's wrong in my calculation of $\int_0^{3 \pi/4} \frac{\cos x}{1 + \cos x}dx$?
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$$
Added,
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$$