I tried doing 2 questions here which I fail to get the answer.

1) ∫$\displaystyle tan^2 (1-3x) dx$

f(x) = tan(1-3x)

f'(x) = -3 sec^2 (1-3x)

By using the integration technique, that is ,

∫f(x)^n * f'(x) = f(x)^(n+1) /(n+1) + c

I'll get,

(1/ (-3sec^2 (1-3x)) * ( tan(1-3x)^3 / 3).

I know something is wrong somewhere, because the answer is $\displaystyle -1/3 tan(1-3x) -x + c$

2) The same goes to the second question, ∫ $\displaystyle sin^2 (2x) dx$.