Indefinite integral - interval of validity of this equality $\int \frac{1}{\sin(x) \cdot \cos(x)} \, dx = \ln \left|\tan(x)\right|$ This is an easy integral so I am just looking for a simple confirmation.
The integral and the answer which I see in my book is this one.
$$\int \frac{1}{\sin(x) \cdot \cos(x)} \, dx = \ln \left|\tan(x)\right|$$
But they say this is true/valid only for $$x \in (0, \pi/2)$$
while I think it is true for $x \in (-\pi/2, 0) \cup (0, \pi/2)$
Am I correct or not?
 A: Yes, you're right. The sign of $x$ can either be positive or negative without changing the result. If $x < 0$, we let $t = - x$, $dt = - dx$, then:
$$\int \frac{1}{\sin x \cdot \cos x}\,\mathrm{d}x = \int \frac{-1}{\sin (-t)\cdot \cos (-t)}\,\mathrm{d}t=\int \frac{1}{\sin t \cdot \cos t} \, \mathrm{d}t=$$
$$ = \ln \left\vert\tan t \right\vert +C =\ln \left\vert \tan x \right\vert+C$$
where $C$ is a constant.
A: To complete the answer of Quan: usually, the integral notation without any set or bounds specified is the notation for indefinite integral, which corresponds to any possible antiderivative (or in a more formal way, the set of antiderivatives). Since the function is not integrable at $x=0$, the antiderivative is not defined in $0$, and so has to be defined on $(-\pi/2,0)\cup (0,\pi/2)$ (if we are only interested in the interval $(-\pi/2,\pi/2)$)
On this domain, the antiderivatives take the form:
$$
\begin{align*}
F(x) &= \ln|\tan(x)| + C_1 \text{ if } x>0
\\
&= \ln|\tan(x)| + C_2 \text{ if } x<0
\end{align*}
$$
