Problem in the solution of a trigonometric equation $\tan\theta + \tan 2\theta+\tan 3\theta=\tan\theta\tan2\theta\tan3\theta$ 
I needed to solve the following equation:
  $$\tan\theta + \tan 2\theta+\tan 3\theta=\tan\theta\tan2\theta\tan3\theta$$

Now, the steps that I followed were as follows.
Transform the LHS first:
$$\begin{split}
\tan\theta + \tan 2\theta+\tan 3\theta
 &= (\tan\theta + \tan 2\theta)
    + \dfrac{\tan\theta + \tan 2\theta}
            {1-\tan\theta\tan2\theta} \\
 &= \dfrac{(\tan\theta + \tan 2\theta)(2-\tan\theta\tan2\theta)}
          {1-\tan\theta\tan2\theta}
\end{split}$$
And, RHS yields
$$\begin{split}
\tan\theta\tan2\theta\tan3\theta
  &= (\tan\theta\tan2\theta)\dfrac{\tan\theta + \tan 2\theta}
     {1-\tan\theta\tan2\theta}
\end{split}$$
Now, two terms can be cancelled out from LHS and RHS, yielding the equation:
$$
\begin{split}
2-\tan\theta\tan2\theta &= \tan\theta\tan2\theta\\
\tan\theta\tan2\theta &= 1,
\end{split}$$
 which can be further reduced as:
$$\tan^2\theta=\frac{1}{3}\implies\tan\theta=\pm\frac{1}{\sqrt3}$$
Now, we can yield the general solution of this equation:
$\theta=n\pi\pm\dfrac{\pi}{6},n\in Z$. But, setting $\theta=\dfrac{\pi}{6}$ in the original equation is giving one term $\tan\dfrac{\pi}{2}$, which is not defined.
What is the problem in this computation?

You concluded from
$$\dfrac{(\tan\theta + \tan 2\theta)(2-\tan\theta\tan2\theta)}{1-\tan\theta\tan2\theta}=(\tan\theta\tan2\theta)\dfrac{\tan\theta + \tan 2\theta}{1-\tan\theta\tan2\theta}$$
(by “canceling” $\dfrac{\tan\theta + \tan 2\theta}{1-\tan\theta\tan2\theta}$ from both sides) that
$$2-\tan\theta\tan2\theta=\tan\theta\tan2\theta.$$
The correct conclusion is that either $\dfrac{\tan\theta + \tan 2\theta}{1-\tan\theta\tan2\theta}=0$ or $2-\tan\theta\tan2\theta=\tan\theta\tan2\theta$. And you still have to check your solutions and keep only those for which the original equation is defined.
Canceling terms doesn’t give you an equivalent equation (one with the same solution set). If you cancel zero, you can lose solutions. If you cancel something undefined, you can introduce wrong solutions.
For example, consider the equation $$\frac{x}{1-x}=\frac{1}{1-x}.$$ If you “cancel” $1-x$ from each side, you get $x=1$, but that is not a solution, because   the equation is not defined when $x=1$. And consider the equation
$${x}({1-x})=2({1-x}).$$ If you “cancel” $1-x$, the only solution to what’s left is $x=2$, and you lose the other solution ($x=1$) to the equation, because for that value, you canceled zero from each side.
To summarize, if $E\cdot A=E\cdot B$, where $E$, $A$, and $B$ are expressions, solutions occur when both 


*

*$E\cdot A$ and $E\cdot B$ are defined

*Either $E=0$ or $A=B$ (or both).

