About $\int \csc(x) \, dx$ One of the suggested proofs that I found to the $\int \csc(x) \, dx$ start with,
$$\int \csc(x) \, dx= \int \csc(x) \cdot \frac{\csc(x)- \cot(x)}{\csc(x)- \cot(x)} dx = \cdots$$
By graphing the function $f(x)=\csc(x)- \cot(x)$ I found that its have zeros for $x=2 \pi k$ for all $k \in \mathbb{Z}$.
So, I wonder if this proof it's valid for all $x \in \mathbb{R}$. Thanks for the clarification.
 A: When you write $\int f(x)\,dx$ and expect to end up with something of the simple form $F(x)+C$, then you are only integrating $f$ over an interval on which $f$ is continuous. $\csc(x)$ has discontinuities at $k\pi$. So what has been done here is valid for say the interval $x\in(0,\pi)$.
The most general antiderivative for $\csc(x)$ would be $$-\ln\left|\csc(x)+\cot(x)\right|+C(x)$$ where $C$ is a function that is piecewise constant on intervals of the form $(k\pi,k\pi+\pi)$, and can take different values on different intervals.
A: The whole point of multiplying by $\dfrac{\csc x - \cot x}{\csc x - \cot x}$ is so that we get $$\int \frac{\csc^2 x - \csc x \cot x}{\csc x - \cot x} \, dx.$$  Then with a substitution of the form $u = \csc x - \cot x$, $du = (-\csc x \cot x + \csc^2 x) \, dx$, the integral is easily evaluated.  Now, if we want to know if the resulting antiderivative is valid, we would simply verify that its derivative equals $\csc x$, and look at its domain.  It is not difficult to see that $\log|\csc x - \cot x| + C$ is defined everywhere except when $\csc x = \cot x$, or $x = \pi k$ for $k \in \mathbb Z$, which also happens to be the domain of $\csc x$ itself.
