TITLE: What is the apparent contradiction in this integral?
QUESTION [6 upvotes]: I was solving this exercise, however it is proposed that there is a possible contradiction in the exercise but I cannot determine what it is.
The idea is to find the integral of $\int{\frac{1}{\sin(x)\cos(x)}dx}$ For this purpose, the following is expressed
$\int{\frac{1}{\sin(x)\cos(x)}dx}=\int{\frac{\cot(x)}{\cos^2(x)}dx}=\int{\cot(x)\tan'(x)dx}=\cot(x)\tan(x)-\int{\tan(x)\cot'(x)dx}=1+\int{\frac{\tan(x)}{\sin^2(x)}dx}=1+\int{\frac{1}{\sin(x)\cos(x)}dx}$
Where does the failure occur? thank you for your help.

REPLY [3 votes]: HINT
Another way to solve the proposed integral:
\begin{align*}
\int\frac{\mathrm{d}x}{\sin(x)\cos(x)} & = 2\int\frac{\mathrm{d}x}{\sin(2x)}\\\\
& = 2\int\frac{\sin(2x)}{\sin^{2}(2x)}\mathrm{d}x\\\\
& = -\int\frac{\mathrm{d}(\cos(2x))}{1 - \cos^{2}(2x)}\\\\
& = \int\frac{\mathrm{d}(\cos(2x))}{\cos^{2}(2x) - 1}
\end{align*}
Can you take it from here?