We can simplify the integral \(\int \tan^2 x \, dx\) using the identity:
\[
\tan^2 x = \sec^2 x - 1.
\]
Thus, the integral becomes:
\[
\int \tan^2 x \, dx = \int (\sec^2 x - 1) \, dx.
\]
Now, integrate each term:
\[
\int \sec^2 x \, dx = \tan x,
\]
\[
\int 1 \, dx = x.
\]
Thus, the integral is:
\[
\tan x - x + c.
\]
Therefore, the correct answer is \( (B) \).