Gợi ý $\tan^2 x +\cot^2 x -2 =(\tan^2 x -1) -(1-\cot^2 x) =\dfrac{\sin^2 x -\cos^2 x}{\cos^2 x}-\dfrac{\sin^2 x -\cos^2 x}{\sin^2 x}$
$=(\sin^2 x -\cos^2 x)(\dfrac{1}{\cos^2 x}-\dfrac{1}{\sin^2 x})=\dfrac{(\cos^2 x-\sin^2 x)^2}{\sin^2 x \cos^2 x}$
Vậy $\int \sqrt{\tan^2 x +\cot^2 x-2}dx=\int \dfrac{\cos^2 x-\sin^2 x}{\sin x \cos x}dx =2\int \dfrac{\cos 2 x}{\sin 2x}dx$
$\int \dfrac{d(\sin 2x)}{\sin 2x}=\ln |\sin 2x| +C$ tự thay cận vào nhé