Fallacious proof involving trigonometry
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.
Solution 1:
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.
Solution 2:
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.
Solution 3:
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.
Solution 4:
The fallacious step is the one where you forgot that $\int \tan(x)\,dx$ is an equivalence class or family of functions.
In other words, the problem $f(x) = \int \tan(x)\,dx$ has a solution set consisting of infinitely many functions that might be named $f$ in that equation. Every function in the solution set has the form $$ f(x) = \log(\cos (x)) + C $$ where $f$ is a function over the interval $(-\pi/2,\pi/2)$ and $C$ is some constant.
The difference $A - B$ when $A$ and $B$ both are equivalence classes consists of all possible values $a - b$ where $a \in A$ and $b \in B.$ Therefore, $$ \int \tan(x)\,dx - \int \tan(x)\,dx = \{f: (-\pi/2,\pi/2)\to\mathbb R\mid (\exists c\in\mathbb R)(\forall x\in\mathbb R) f(x) = c\},$$ that is, the difference of the two integrals is the set of all real-valued constant functions over the same domain as $\int \tan(x)\,dx,$ because for any real number there is some member of $\int \tan(x)\,dx$ that you can subtract from another member of $\int \tan(x)\,dx$ to get the desired number as your difference.
Now it is certainly true that there are constant functions $C_1$ and $C_2$ such that $$ C_1 = -1 + C_2,$$ but it is not true that both of those functions will always be the zero function, and you cannot conclude that $0 = -1.$
If all this talk of equivalence classes is too much, you can just remember to add the constant of integration everywhere you use an indefinite integral. Also make sure that if you have two integrals, each one gets its own constant of integration, even if they are integrals of the same integrand. You can replace the sum or difference of two constants of integration by a new constant, but you cannot assume their difference is zero.