I need help verifying why I am getting an incorrect answer for the question evaluate the integral $$\int \tan\left(\frac{x}{3}\right) \, dx$$
I simplify the above equation using trig identities to get $$\int \frac {\sin \left(\frac{x}{3}\right)}{\cos\left(\frac{x}{3}\right)} \, dx$$
I use the substitution method to find $$ du = -\frac{1}{3} \sin(x/3) \, dx$$ and so $dx = \frac{-3\,du}{\sin\frac{x}{3}}$
I plug the $u$ back into equation $$ \int \frac {\sin\left(\frac{x}{3}\right)}{u} \cdot\frac {-3\,du}{\sin \left(\frac{x}{3}\right)}$$
I cross out the $\sin \left(\frac{x}{3}\right)$ and (this is where I may be going wrong), I pull out the $-3$ to be in front of the integral sign since it is a constant and solve for $$-3 \int \frac{1}{u} \, du$$ and get the final answer $$ -3 \biggl|\,\ln \, \cos \frac{x}{3}\biggr| + C $$
But the answer in the back of the book is $ -\frac{1}{3} |\ln \, \cos \frac{x}{3}| + C $