Fallacious proof involving trigonometry

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.


As an adjunct to Misha Lavrov's answer, this is probably not the first time you have encountered this phenomenon.

In trigomometry, one might be faced with $\cos(\theta) = \frac{\sqrt{2}}{2}$. The solutions to this equation are, of course, $\theta = \pm \cos^{-1}\left( \frac{\sqrt{2}}{2} \right) + 2 \pi k = \pm \frac{\pi}{4} + 2 \pi k$, for any integer $k$. Some people normalize these so that all the particular angles are positive, so $\theta = \frac{\pi}{4} + 2 \pi k$ or $\theta = \frac{7\pi}{4} + 2 \pi k$, for any integer $k$.

Well this means \begin{align*} \left\{\frac{-\pi}{4} + 2 \pi k, k \in \mathbb{Z}\right\} &= \left\{\frac{7\pi}{4} + 2 \pi k, k \in \mathbb{Z} \right\} & &\text{True.} \\ \frac{-\pi}{4} &= \frac{7\pi}{4} & &\text{False.} \\ \end{align*}

Just because two sets are equal, which is what you have at $$ \int \tan x \,\mathrm{d}x = -1 + \int \tan x \,\mathrm{d}x \text{,} $$ does not mean that two randomly selected elements of those sets are equal.


Remember the mantra: "... plus a constant". $\int x^2 = \frac {x^3}{3}$ .... PLUS A CONSTANT.

So in your proof:

"Therefore $\int\tan(x)dx=-\sec(x)\cos(x)+ C + \int\cos(x)\tan(x)\sec(x)dx$ "

"but $\cos(x)\sec(x)=1$ so:"

"$\int\tan(x)dx=-1 + C +\int\tan(x)dx$"

"We subtract both sides by $\int\tan(x)dx$"

"$\int\tan(x)dx-\int\tan(x)dx = -1 + C +\int\tan(x)dx - \int\tan(x)dx$

"Then:"

"$0 = -1 +C$"

$C = 1$

And therefore we have proven that .... $1$ is a constant.