I'm having issues with the integral $$\int_{-1}^1 \frac{1}{|x|}dx$$ Solving it conventionally gives me values such as $\ln 0$ and $\ln(-1)$ which are indeterminate on the real plane. Is there a way to evaluate this integral?
Context: I came across this integral when trying to solve a related problem: "Use a fourth degree polynomial to approximate $1/|x|$ using the Least Square Method with Legendre Polynomial."
The integral is divergent and does not exist
There is certainly a sense in which your reasoning applies; if you consider $\displaystyle\int_{-1}^{-\epsilon}\frac{1}{x}\;dx+\displaystyle\int_{\epsilon}^{1}\frac{1}{x}\;dx$ , then this is always $0$, for the exact symmetry reason you refer to, so that, furthermore, this is $0$ even in the limit as $\epsilon$ goes to $0$, in which case the limiting bounds of the integrals are from $-1$ to $0$ and from $0$ to $1$.
But consider, say, $\displaystyle\int_{-1}^{-2\epsilon}\frac{1}{x}\;dx+\displaystyle\int_{\epsilon}^{1}\frac{1}{x}\;dx$. Again, as $\epsilon$ approaches $0$, the limiting bounds of the integrals are from $-1$ to $0$ and from $0$ to $1$; however, this time, rather than approaching $0$, the sum of these integrals constantly evaluates to $\ln (2)$ .
And we could just as easily make similar setups wherein we have any other value we like coming as the output. For these sorts of reasons, it can be difficult to settle on a coherent useful account of what the integral of $1/x$ from $-1$ to $1$ should evaluate to, and similarly for other integrals over regions on which they can be split into infinite parts of opposing sign. In other words, as some might put it, "You can't take an integral of $1/x$ from $-1$ to $1$".
Ultimately, this amounts to the same as the difficulty of devising a coherent and useful account of the arithmetic of subtracting infinite quantities from infinite quantities. Consider an expression such as $\infty-\infty$ , where $\infty$ is thought of as something like the infinite sum $1 + 1 + 1 + ....$ It's quite natural to take $1 + 1 + 1 + ... = 1 + (1 + 1 + 1 + ...)$, so that $\infty=1+\infty$ , which is to say $0+\infty=1+\infty$ . On the other hand, we almost certainly do not want to be able to subtract ∞ from both sides of this last equation to conclude that $0=1$ . For reasons like this, even in the context of systems such as the affinely extended numbers where one is willing to speak of numbers representing unboundedly large integrals as arithmetic entities capable of being added and so on, one is generally still unwilling to speak of subtracting such infinite numbers from themselves.
That having been said, if one does not limit oneself to the real line, there can be alternative paths from $-1$ to $1$ which do not cross $0$ and thus manage to avoid troublesome infinities (e.g., in the complex plane, one can take the integral of $1/x$ dx from $-1$ to $1$ along a number of different paths which curve around the origin $0$, and can obtain any odd multiple of $\pi i$ as a resulting answer. More specifically, for any particular path of integration, the magnitude of the answer one obtains will be the total angle, in radians, by which that path cumulatively rotates around $0$).