Solving $\tan(2x)\tan(x)=1$ two ways gives different solutions While solving this Equation by 2 ways I am getting different solution
$$\tan(2x)\tan(x)=1$$
So, I solved it in two ways.
Method-1



This gives solution as:
x=nπ ± π/6
Which is also given as solution
Method-2





Where did I go wrong
And how to solve correctly using Method-2
 A: Indirectly the situation of finding zeros of $\tan x= \dfrac{ \sin x }{ \cos x }$ in method 1 is not sensitive to the denominator $\cos x $ which should not go to zero.
An alternate way is to conveniently introduce it entirely in the denominator for method 1:
$$ \dfrac{\tan x + \tan 2x}{1-\tan x \tan 2x} = \infty \to \tan 3x = \infty$$
$$ 3x = (2n+1)\pi/2 \to  x = (2n+1)\pi/6   $$
which result coincides with the only correct method and result of method 2.
Or more directly,
$$ {1-\tan x \tan 2x}  =0, \quad \cos x \cos 2x - \sin x \sin 2x $$
$$ = \cos ( x+2 x)= \cos 3x=0  \to x = (2n+1)\pi/6. $$
A: The mistake is in the step where you go from
$$
\tan(x) = \tan\left(\frac\pi2 - 2x\right)  \tag{$\mathrm A$}
$$
to
$$
x \stackrel?= n\pi + \frac\pi2 - 2x.   \tag{$\mathrm B$}
$$
This step would be completely correct if it were true that for every real number $\theta,$ there is some integer $k$ such that
$\arctan(\tan(\theta)) = \theta + k\pi.$
Such an integer $k$ actually does exist for almost every real number $\theta$
... but not for $\theta = \frac\pi2,$ or for $\theta = -\frac\pi2,$
or $\theta = \frac32\pi$ or $\theta = -\frac32\pi$ or any other $\theta$ that differs from $\frac\pi2$ by an exact integer multiple of $\pi.$
The problem with $\theta = \frac\pi2$ (or any of these other $\theta$ values)
is that $\tan\left(\frac\pi2\right)$ is undefined
and therefore cannot be used as input to the inverse tangent function.
Instead of the incorrect Equation (B), you could instead write
$$
\exists n\in\mathbb N:(x = n\pi + \frac\pi2 - 2x)
 \quad\text{and}\quad
\forall k\in\mathbb N:(x \neq \frac\pi2 + k\pi).
 \tag{$\mathrm B'$}
$$
From $(\mathrm B')$ you could deduce that
$$
x = \frac{n\pi}{3} + \frac\pi6 \neq \frac\pi2 + k\pi,
$$
or equivalently
$$
x = \frac{n\pi}{3} + \frac\pi6 \quad\text{where}\quad n \not\equiv 1 \pmod3.
$$
The values of $x$ that satisfy this last statement are the same ones you get by the first method:
\begin{align}
\frac{0\pi}{3} + \frac\pi6 &= \frac\pi6, \\
\frac{-1\pi}{3} + \frac\pi6 &= -\frac\pi6,
\end{align}
and all the values of $x$ you can get by adding a multiple of $3$ times $\frac\pi3$ (that is, adding an exact integer multiple of $\pi$).
