Problem 1:
$\int \tan x\, dx$
The answer in the book is $-\ln |(\cos x)|+C$. I used the following steps: $$\ln |\sec x|+C$$ $$\ln |(\cos x)^{-1}|+C$$ $$-\ln |(\cos x)|+C$$
Problem 2:
$\int \frac{\sin 2x}{1-\cos 2x}\, dx$
The answer in the book is $\ln \sqrt{|1-\cos 2x|}+C$. I used the following steps: $$u=1-\cos 2x$$ $$dx=\frac{du}{2\sin 2x}$$ $$\frac{1}{2}\int \frac{1}{u}\, du$$ $$\frac{1}{2}\ln |1-\cos 2x|+C$$ Here is where I get confused. Based on problem 1, $\frac{1}{2}\ln |1-\cos 2x|+C$ should equal $\ln |\sqrt{1-\cos 2x}|+C$ but it must equal $\ln \sqrt{|1-\cos 2x|}+C$ because that's the correct answer. So what is the rule when turning the number in front of a logarithm into an exponent when an absolute value is in the logarithm argument?
$1-\cos \, t \geq 0$ for all real numbers $t$ so absolute values signs are unnecessary in your answer as well as the given answer. So the two answers are the same.