A strange answer for $\int _{-1}^1 \log x\; dx$ I typed $\int _{-1}^1 \log x\; dx$ on Wolfram Alpha. It is giving the answer to be $-2+i\pi$. Can someone please explain what is happening?
 A: WA is probably summing the well-defined integrals $$\int_0^1\log x\,\mathrm dx=\left.x\log x-x\right|_0^1=-1$$ and $$\int_{-1}^0\log x\,\mathrm dx,$$ using the convention that, when $x$ is real and negative, $\log x=\mathrm i\pi+\log|x|$, hence  $$\int_{-1}^0\log x\,\mathrm dx=\int_0^1(\mathrm i\pi+\log u)\,\mathrm du=\mathrm i\pi-1,$$ by the first computation.
The validity of such a move could be questioned since an equally valid definition of the (complex) logarithm on the negative real axis would be that $\log x=-\mathrm i\pi+\log|x|$ for every $x\lt0$, or that $\log x=43\mathrm i\pi+\log|x|$ for every $x\lt0$, or that...
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
With the $\ds{\ln}$-branch cut:
$$
\ln\pars{z}=\ln\pars{\verts{z}} + {\rm Arg}\pars{z}\ic\,,\quad
-\,{\pi \over 2} < {\rm Arg}\pars{z} < {3\pi \over 2}\,,\quad z \not= 0 
$$

\begin{align}&\lim_{\epsilon\ \to\ 0^{+}}\braces{%
\int_{-1}^{-\epsilon}\bracks{\ln\pars{-x} + \pi\,\ic}\,\dd x
+\int_{\pi}^{0}
\ln\pars{\epsilon\expo{\ic\theta}}\,\epsilon\expo{\ic\theta}\ic\dd\theta
+\int_{\epsilon}^{1}\ln\pars{x}\,\dd x}
\\[3mm]&=\lim_{\epsilon\ \to\ 0^{+}}\braces{%
\int_{\epsilon}^{1}\bracks{\ln\pars{x} + \pi\ic}\,\dd x
+\int_{\epsilon}^{1}\ln\pars{x}\,\dd x}
=2\ \overbrace{\int_{0}^{1}\ln\pars{x}\,\dd x}
^{\ds{\color{#c00000}{\large=\ -1}}}\ +\ \pi\ic
\\[3mm]&=\color{#66f}{\Large -2 + \pi\ic}
\end{align}

