What is the apparent contradiction in this integral? 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.
 A: There is no failure. You've shown that
$$\int{\frac{1}{\sin(x)\cos(x)}dx}=1+\int{\frac{1}{\sin(x)\cos(x)}dx},$$
which is correct, even if unhelpful: recall that $\int f(x)\,dx$ denotes the set of all antiderivatives of $f(x)$, all of which are a constant apart from one another. This means that it is in general true that for any function $f(x)$ we have $\int f(x)\,dx = 1 + \int f(x)\,dx$. Your derivation is correct, but it does not lead to a solution of the integral.
(To actually solve the integral, you can use the Weierstrass half-angle substitution, i.e. $t=\tan(\frac{x}{2})$, and you may simplify beforehand using $\sin(2x)=2\sin(x)\cos(x)$.)
A: 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?
