Which step in the following incorrect proof is fallacious? Is it something with the use of indefinite integrals or with the domain and range of trignometric functions? I encountered this fallacious proof here.
$$ \int\tan(x)\,dx=\int\tan(x)\,dx $$
substitute $\tan(x)$ :
$$ \int\tan(x)\,dx=\int\sin(x)\sec(x)\,dx $$ Integrate by parts, assume
$$ u=\sec(x),dv=\sin(x)\,dx $$
Therefore, $$ \int\tan(x)\,dx=-\sec(x)\cos(x)+\int\cos(x)\tan(x)\sec(x)\,dx $$ but $\cos(x)\sec(x)=1$ so:
$$ \int\tan(x)\,dx=-1+\int\tan(x)\,dx $$ we subtract both sides by $\int\tan(x)\,dx$ :
$$ \int\tan(x)\,dx-\int\tan(x)\,dx =-1+\int\tan(x)\,dx-\int\tan(x)\,dx $$
then:
$0=-1$
Thanks in advance for any help.
These are indefinite integrals; you need to add $C$. It's true that $0+C_1 = -1+C_2$ for some constants $C_1$ and $C_2$.
(And if they were definite integrals, the $0$ and $-1$ would wash out when we subtracted the upper bound from the lower.)
More specifically, I would say that the next-to-last line, $$ \int \tan x\,\text{d}x = -1 + \int \tan x\,\text{d}x $$ is still true. But when you're just canceling the integral of $\tan x$ from both sides, you're forgetting that the integrals are only defined up to a constant, and that constant absorbs the $-1$. What the line above is really saying is that there's some function $F(x)$ whose derivative is $\tan x$ for which $$ F(x) + C_1 = -1 + (F(x)+ C_2) $$ which is perfectly true for some constants $C_1$ and $C_2$.
Alternatively, we can think of the problem as simplifying $$ \int \tan x\,\text{d}x - \int \tan x\,\text{d}x = \int 0\,\text{d}x $$ to $0$: the $+C$ doesn't disappear just because we're integrating $0$.
These two integrals are actually a good example of why we need to add $C$ for an indefinite integral: two antiderivatives of a function are not guaranteed to be equal, only to differ by an arbitrary constant.