# About $\tan(A +B)$

How is it that $$\tan(A +B) = \frac{\tan A + \tan B}{1-\tan A\tan B}$$ for any value of $A$, $B$?

I have doubts about this since we arrive at this by dividing the numerator and denominator of $$\frac{\sin(A+B)}{\cos(A+B)}$$ by $\cos A \cdot \cos B$, which can only be done when $\cos A\cdot\cos B$ is not equal to zero.

-
tan(A+B) is NOT equal to (tanA+tanB)/(1-tanAtanB) when cos(A)cos(B)=0 since then tanA and/or tanB do not exist hence the RHS is not defined. –  Did Aug 27 '12 at 12:33
Strictly speaking, the tangent formula doesn't make sense when a cosine is zero, because when it is the tangent of that angle is undefined. –  Gerry Myerson Aug 27 '12 at 12:33
So it seems you just need to modify your statement to be "for any $A$ and $B$ which the expression is defined." This is usually implicit when talking about identities. –  rschwieb Aug 27 '12 at 12:39
you need $A,B,A+B \neq \frac{\pi}{2}(2n-1)$ for $n \in \mathbb{Z}$ for the identity to hold. –  James S. Cook Aug 27 '12 at 12:55
I'd ask whether the identity makes sense if we define $\tan(\pm\pi/2) = \infty$, where there's just one $\infty$, at both ends of the line, rather than $+\infty\ne-\infty$. In other words, let $\tan$ take values in the projective line. I'll be surprised if that doesn't have an affirmative answer. –  Michael Hardy Aug 27 '12 at 17:53

You can think it like this way: If either cos(A) or cos(B) is zero, then we may take its limit of RHS and the equality makes sense.

-

Note that $$\tan(A +B) = \frac{\tan A + \tan B}{1-\tan A\tan B}$$ holds only if both $(i)\space A\ne \frac{\pi}{2}+k\pi$ and $(ii)\space B\ne \frac{\pi}{2}+l\pi$ for all $k,l\in\mathbb{Z}$ are satisfied. Otherwise, at least one of the values $\tan A$ or $\tan B$ does not exist since $\tan x=\frac{\sin x}{\cos x}$ whilst the zeros of cosine are of the aforementioned form.

The inconvenient case, though, one could simplify directly. Suppose $(i)$ holds, then $$\tan(A+B)= \tan\left(\frac{\pi}{2}+k\pi+B\right)\stackrel{\text{periodicity}}{=}\tan\left(\frac{\pi}{2}+B \right) \stackrel{\text{trig. identity}}{=}-\cot(B).$$

Assured of ability to handle the tangent of sum when $(i)$ or $(ii)$ is true, one can assume that both $\cos A$ and $\cos B$ are not $0$ and divide by it in order to obtain the discussed expression.

-