Solving the Double Angle Tangent Formula for $\tan x$ The double angle formula for $\tan(x)$ is as follows:
$$\tan(2x) = \frac{2\tan(x)}{1-\tan^2 (x)}$$
I wanted to see if I could solve this equation for $\tan(x)$—I figured that I could manipulate this equation to put it in the form of a quadratic equation**.
$$\tan(2x)(\tan x)^2 + 2(\tan x) - \tan(2x) = 0 
\\ \implies \tan(x) = \frac{-2 \pm \sqrt{4 - 4(\tan(2x))(-\tan(2x))}}{2\tan(2x)}
$$
Conveniently, the expression for $\tan(x)$ simplifies to
$$ \tan(x) = \frac{-1 \pm \sec(2x)}{\tan(2x)}$$
Before calling it a day, I checked to see if any of these branches of the solution were extraneous. As it turns out, the negative branch is extraneous, and is actually equal to $\tan{\left( x - \frac{\pi}{2} \right)} = -\cot(x)$.
This is where I’m confused. Both branches of the expression are valid solutions to both the quadratic equation and the original double angle equation. So why isn’t $\tan (x)$ equal to both of them? I know that would be ridiculous, but I can’t see where this phase shift by $\frac{\pi}{2}$ comes from.
**I doubted at first whether the quadratic equation applies in a case where the coefficients (a, b, and c) are functions of the equation's independent variable, in this case $x$. However, I decided to continue anyway, since the alternative "safer" way to solve this would be to complete the square, but that's essentially equivalent to using the quadratic formula anyway.
 A: $$\tan\left(x - \frac{\pi}{2}\right) = \frac{-1}{\tan(x)} ~: ~0 < x < \pi/2.$$
Evaluating:
$$\frac{2\left(\frac{-1}{\tan(x)}\right)}{1 - \left[ ~\left(\frac{-1}{\tan(x)}\right)^2 ~\right]}$$
$$= \frac{\frac{-2}{\tan(x)}}{\frac{\tan^2(x) - 1}{\tan^2(x)}} = \frac{2\tan(x)}{1 - \tan^2(x)} = \tan(2x).$$
A: Thanks to @EricSynder, @user2661923, and @Blue for your help in answering this question.

To begin, to answer the question of why this expression for $\tan(x)$ comes up it turns out it's my fault. At the following step:
$$\tan(x) = \frac{-1 \pm \sqrt{1 + \tan^2 (2x)}}{\tan(2x)}$$
The $\pm \sqrt{1 + \tan^2 (2x)}$ term should have simplified to $+\sec(2x)$, not $\pm \sec(2x)$. Otherwise, that would imply that $\sec(x) = \sqrt{1 + \tan^2 (x)}$ for all real numbers, but this equation is only correct for half of the $\sec(x)$ function.

(At the moment, I only have time to type out half of my answer. Once I have more time, I'll add the second part that addresses why the incorrect expression for tanx happens to be just a phase shift).
A: If $T$ is the tangent of the double angle,
$$ T=\frac{2t}{1-t^2},~ Tt^2+2t-T=0,~$$
$$ ~ t_1=\frac{\sqrt{1+T^2}-1}{T},~ t_2=\frac{-\sqrt{1+T^2}-1}{T},~$$
which can be also expressed in terms of secant you have given.
In the solution of a quadratic equation both solutions are correct.
Product of roots is $-1$ so that the vectors of single angles are orthogonal.
Sketched is for a situation when tangent double angle $150^{\circ}$ is
$$\tan  2\theta=\frac{-1}{\sqrt 3},\tan \theta_{1,2}=\pm(2-\sqrt 3),~$$
and for half angles
$$ 75^{\circ}, -15^{\circ}.~ $$
Two solutions out of four in other quadrants viz.,
$$165^{\circ}, 255^{\circ}~ $$
are not included in the sketch for clarity.

