Did I integrate correctly? Integration using algebraic substitution. 
Integrate with respect to $x$
  $$\int3{\sec^2(3x)\tan(3x)dx}$$

There's 2 ways of doing this according to the book, I just wish to know if I did both ways correctly...please correct me on where I went wrong
Method 1:
$$3\int{\sec^2(3x)\tan(3x)dx}$$
$u=3x;\dfrac{1}{3}du=dx$
$$3\int{\dfrac{\sec^2(3x)\tan(3x)}{3}du}$$
$$\int{\sec^2(3x)\tan(3x)du}$$
$v=sec(3x);\dfrac{dv}{sec(3x)}=\tan(3x)du$
$$\int{\dfrac{\sec^2(3x)dv}{\sec(3x)}}$$
$$\int{\sec(3x)dv}$$
$$\dfrac{1}{2}\sec^2(3x)+C$$
Method 2:
$$3\int{\sec^2(3x)\tan(3x)dx}$$
$u=3x;\dfrac{1}{3}du=dx$
$$3\int{\dfrac{\sec^2(3x)\tan(3x)}{3}du}$$
$$\int{\sec^2(3x)\tan(3x)du}$$
$v=\tan(3x);dv=\sec^2(3x)du$
$$\int{\tan(3x)dv}$$
$$\dfrac{1}{2}{\tan^2(3x)}+ C$$
 A: Both answers are correct. In fact you can differentiate your answers with respect to $x$ to see it gives the integrand to check your answer.
For your interest, your two answers are equivalent because
$$\frac{1}{2} \sec^2(3x) + C_1= \frac{1}{2}(\tan^2(3x) + 1)+C_1 = \frac{1}{2}\tan^2(3x) +C_2$$
A: $$\int 3sec^2(3x)tan(3x)dx$$ use this substitution :$$u=tan(3x)\\du=3(1+tan^(3x)dx=3sec^2(3x)dx\\3sec^2(3x)tan(3x)dx=3sec^2(3x)dx *tan(3x)=\\du *u$$so $$\int 3sec^2(3x)tan(3x)dx=\int udu=\frac{1}{2}u^2=\\\frac{1}{2}tan^2(3x) +const$$
A: You should write like this:
$$3\int{\sec^2(3x)tan(3x)dx}$$
put $u=3x;\dfrac{1}{3}du=dx$
$$3\int{\dfrac{\sec^2(u)tan(u)}{3}du}$$
Put $v=sec(u);\dfrac{dv}{sec(u)}=\tan(u)du$
$\int{vdv}=\frac{v^2}{2}+c$, Now replacing back the values,we have the final solution as,  $$\dfrac{1}{2}\sec^2(3x)+C$$
Method2: $$3\int{\sec^2(3x)tan(3x)dx}$$
put $u=3x;\dfrac{1}{3}du=dx$
$$3\int{\dfrac{\sec^2(u)tan(u)}{3}du}$$
$v=\tan(u);dv=\sec^2(u)du$
$\int{vdv}=\frac{v^2}{2}+c$, Now replacing back the values,we have the final solution as, $$\dfrac{1}{2}{\tan^2(3x)}+ C$$
