Step-by-step explanation:
Recall that
[tex]1 + \tan^2 x = \sec^2 x[/tex]
and
[tex]\dfrac{d}{dx}(\tan x) = \sec^2 x[/tex]
so that
[tex]\displaystyle \int \tan^2 x = \int (\sec^2 x - 1)dx[/tex]
[tex]\:\:\:\:\:\:\:\:\:=\int \sec^2 xdx - \int dx[/tex]
[tex]\:\:\:\:\:\:\:\:\:=\tan x - x + C[/tex]
where C is the constant of integration.