\[tg\ x > 0;\]
\[\cos x + \left( 1 + \cos x \right)tg^{2}\ x - 1 = 0\]
\[\cos x + \left( 1 + \cos x \right) \bullet \frac{\sin^{2}x}{\cos^{2}x} - 1 = 0\]
\[\frac{\cos x - 2\cos^{2}x + 1}{\cos^{2}x} = 0\]
\[\frac{2\cos^{2}x - \cos x - 1}{\cos^{2}x} = 0\]
\[D = 1 + 8 = 9\]
\[\cos x_{1} = \frac{1 - 3}{2 \bullet 2} = - \frac{1}{2};\]
\[\cos x_{2} = \frac{1 + 3}{2 \bullet 2} = 1;\]
\[x_{1} = \pm \arccos\left( - \frac{1}{2} \right) + 2\pi n =\]
\[= \pm \frac{2\pi}{3} + 2\pi n;\]
\[x_{2} = 2\pi n;\ \]
\[x \neq \frac{\pi}{2} + \pi n.\]
\[Ответ:\ \ \frac{\pi}{3} + (2n + 1)\text{π.}\]