This is a question which tests your knowledge of how to use trigonometric identities as well as integration. As there is no way to immediately integrate tan^2(x) using well known trigonometric integrals and derivatives, it seems like a good idea would be writing tan^2(x) as sec^2(x) - 1.
Now, we can recognise sec^2(x) as the derivative of tan(x) (you can prove this using the quotient rule and the identity sin^2(x) + cos^2(x) = 1), while we get x when we integrate 1, so our final answer is tan(x) - x + c.