Another way: If you look in the back of your Calc. book, it sould have a list of commonly used integrals.
\(\displaystyle The \ one \ we \ are \ interested \ in \ is; \ \int tan^{n}(u)du \ = \ \frac{tan^{n-1}(u)}{n-1} \ - \ \int tan^{n-2}(u)du.\)
\(\displaystyle Hence, \ 12\int tan^{6}(3x)dx \ = \ 4\int tan^{6}(u)du, \ letting \ u \ = \ 3x, \ we \ get\frac{du}{3} \ = \ dx.\)
\(\displaystyle Ergo, \ 4\int tan^{6}(u)du \ = \ 4[\frac{tan^{5}(u)}{5} \ - \ \int tan^{4}(u)du]\)
\(\displaystyle Now, \ \int tan^{4}(u)du \ = \ \frac{tan^{3}(u)}{3} \ - \ \int tan^{2}(u)du \ and\)
\(\displaystyle \int tan^{2}(u)du \ = \ tan(u)-\int du \ = \ tan(u)-u+C.\)
\(\displaystyle Putting \ it \ all \ together \ we \ get: \ 4\int tan^{6}(u)du \ = \ 4[\frac{tan^{5}(u)}{5}-\frac{tan^{3}(u)}{3}+tan(u)-u]+C\)
\(\displaystyle Ergo: \ 12\int tan^{6}(3x)dx \ = \ \frac{4tan^{5}(3x)}{5}-\frac{4tan^{3}(3x)}{3}+4tan(3x)-12x+C, \ u \ = \ 3x, \ du \ = \ 3dx.\)
\(\displaystyle Check: \ D_x[\frac{4tan^{5}(3x)}{5}-\frac{4tan^{3}(3x)}{3}+4tan(3x)-12x+C] \ = \ 12tan^{6}(3x).\)
\(\displaystyle The \ above \ check \ would \ be \ a \ good \ exercise \ in \ your \ derivative \ acumen.\)