Solve this trigonometric equation ${\tan ^2}x + {\cot ^2}x - 3(\tan x - \cot x) = 0$ 
Solve the following equation. $${\tan ^2}x + {\cot ^2}x - 3(\tan x - \cot x) = 0.$$

I can't figure out the way to solve this equation. This was my attempt
\begin{array}{l}
{\tan ^2}x + {\cot ^2}x - 3(\tan x - \cot x) = 0\\
 \Leftrightarrow \frac{{{{\sin }^2}x}}{{{{\cos }^2}x}} + \frac{{{{\cos }^2}x}}{{{{\sin }^2}x}} - 3(\frac{{\sin x}}{{\cos x}} - \frac{{\cos x}}{{\sin x}}) = 0\\
 \Leftrightarrow \frac{{{{\sin }^4}x + {{\cos }^4}x}}{{{{\cos }^2}x + {{\sin }^2}x}} - 3\frac{{{{\sin }^2}x - {{\cos }^2}x}}{{\sin x\cos x}} = 0\\
 \Leftrightarrow \frac{{1 + 2{{\sin }^2}x{{\cos }^2}x}}{{{{\sin }^2}x{{\cos }^2}x}} + 3\frac{{\cos 2x}}{{\sin x\cos x}} = 0\\
 \Leftrightarrow \frac{4}{{(1 - \cos 2x)(1 + \cos 2x)}} + 2 + 3\frac{{\cos 2x}}{{\sin x\cos x}} = 0\\
 \Leftrightarrow \frac{4}{{1 - {{\cos }^2}2x}} + 2 + 3\frac{{\cos 2x}}{{\sin x\cos x}} = 0
\end{array}
I don't know how to solve after that. Can anyone help me? 

Let $\tan{x}-\cot{x}=t$.
Thus, $$t^2+2-3t=0.$$
For $t=1$ we obtain
$$\tan^2x-\tan{x}-1=0,$$
which gives $x=\arctan\frac{1\pm\sqrt5}{2}+\pi k$, where $k\in\mathbb Z$.
For $t=2$ we obtain
$$\tan^2x-2\tan{x}-1=0,$$ which gives
$x=\arctan(1\pm\sqrt2)+\pi k$, where $k\in\mathbb Z$.
Actually, $\arctan(1+\sqrt2)=\frac{3\pi}{8}$ and $\arctan(1-\sqrt2)=-\frac{\pi}{8}$.
