Step 1: Rewrite with half-angle form.
Use the standard results $\cos 2x = 1 - 2\sin^2 x$ and $\cos 2x = 2\cos^2 x - 1$. They give $1 - \cos 2x = 2\sin^2 x$ and $1 + \cos 2x = 2\cos^2 x$.
Step 2: Reduce the fraction.
Dividing the first by the second, the integrand becomes $\frac{2\sin^2 x}{2\cos^2 x} = \left(\frac{\sin x}{\cos x}\right)^2 = \tan^2 x$.
Step 3: Use the Pythagorean identity.
From $1 + \tan^2 x = \sec^2 x$ we get $\tan^2 x = \sec^2 x - 1$. This form is useful because $\sec^2 x$ is the derivative of $\tan x$.
Step 4: Integrate each piece.
\[ \int (\sec^2 x - 1)\,dx = \tan x - x + k \]
Step 5: Test the options by differentiating.
The derivative of $\tan x - x$ is $\sec^2 x - 1 = \tan^2 x$, which matches.
Option (1) has derivative $\sec^2 x + 1$, which is not $\tan^2 x$.
Option (3) has derivative $1 - 2\tan x \sec^2 x$, which is not $\tan^2 x$.
Option (4) has derivative $\frac{1}{2}\sec^2 \frac{x}{2}$, which is not $\tan^2 x$.
So only option (2) works.
Final Answer:
The value of the integral is $\tan x - x + k$.
\[ \boxed{\tan x - x + k} \]