Validity of a trigonometric proof that $2 = 0$. I can't find where this proof goes wrong.
We know
$$\tan(A - B)  = \frac{\tan A - \tan B}{1 + \tan A\cdot\tan B}$$
so 
$$\begin{align} \tan(90^\circ-45^\circ) &=  \frac{\tan 90^\circ -\tan 45^\circ}{1+\tan90^\circ\cdot\tan 45^\circ}\\[.3cm] \tan45^\circ &=\frac {\tan 90^\circ -\tan 45^\circ}{1+\tan90^\circ\cdot\tan45^\circ}\\[.3cm]1 &=\frac{\tan 90^\circ - 1}{1+\tan90^\circ}\\[.3cm] 1+\tan90^\circ &= \tan 90^\circ - 1 \\[.3cm]2 &= 0\end{align}$$
Where is the error?
 A: The correct identity is
$$
\tan(A-B)=\frac{\tan A-\tan B}{1+\tan A\tan B}
$$
provided $\tan(A-B)$, $\tan A$ and $\tan B$ are defined.
Assuming $\tan(\pi/2)$ can be given a meaning and setting $A=\pi/2$ and $B=\pi/4$, we'd have $A-B=B$, so, recalling that $\tan(\pi/4)=1$,
$$
1=\frac{\tan(\pi/2)-1}{1+\tan(\pi/2)}
$$
which would give
$$
1+\tan(\pi/2)=\tan(\pi/2)-1
$$
or
$$
1=-1
$$
that is absurd. Therefore the conclusion is not that $1=-1$, but that $\tan(\pi/2)$ can't be given a meaning, in general.
Note. As Daniel Fischer points out in a comment, there are contexts where setting $\tan(\pi/2)=\infty$ can be sensible and this value can be used for some limited arithmetic. In these cases, the conclusion we can draw from the above argument is just that $1+\infty=\infty-1$, which is coherent with the rules in those contexts.
A: Remember that $$\tan(\theta)=\dfrac{\sin(\theta)}{\cos(\theta)}.$$
If we set $\theta=90^\circ$ we get: $$\tan(90^\circ)=\dfrac{\sin(90^\circ)}{\cos(90^\circ)}=\dfrac{1}{0}\text{ undefined!}$$
The identity you've given is true for all the numbers for which $\tan$ is defined. And $90^\circ$ is not one of them. So you can't use it to derive any kind of result.
A: This is what's actually going on here.
Let's fast forward to:
$$\tan 45^{\circ} = \frac{\tan 90^{\circ} - \tan 45^{\circ}}{1 + \tan 90^{\circ}\tan 45^{\circ}}$$
$$\tan 45^{\circ} = \frac{\tan 90^{\circ} - 1}{1 + \tan 90^{\circ}}$$
Up to this point, your derivation is correct.
Now recognise that $\displaystyle \tan 90^{\circ}$ is undefined in the real numbers. However, $\displaystyle \lim_{\theta \to 90^{\circ}}\tan \theta = \infty$, or to put it in terms of radian measure which is more conventional, $\displaystyle \lim_{\theta \to \frac{\pi}{2}}\tan \theta = \infty$. That is, the tangent of an angle tends to infinity as the angle tends to a right angle.
So what you have on the right hand side (RHS) of your expression is a fraction where both the numerator and denominator are tending to infinity. At this point, you should realise that multiplying both sides by the denominator is invalid and you will get anomalous, and likely incorrect, results.
However, there is actually no contradiction here if you actually evaluate the limit of the RHS using basic calculus techniques. You can use L' Hopital's Rule to work out limits of the form $\displaystyle \frac{\infty}{\infty}$. If both $f(\theta) \to \infty$ and $g(\theta) \to \infty$ as $\theta$ tends to a particular value, then the rule tells us that:
$$\lim \frac{f(\theta)}{g(\theta)} = \lim \frac{f'(\theta)}{g'(\theta)}$$
(note that we're differentiating both numerator and denominator separately in the second expression).
So, working in radian measure which is customary in calculus, apply that here to get:
$$\tan \frac{\pi}{4} = \lim_{\theta \to \frac{\pi}{2}}\frac{\tan \theta - 1}{1 + \tan \theta} = \lim_{\theta \to \frac{\pi}{2}}\frac{\sec^2\theta}{\sec^2\theta} = 1$$
or simply, that $\displaystyle \tan \frac{\pi}{4}=1$
So there is no contradiction at all if you use valid techniques and operations.
