How to treat absolute value bars in $\log\left|\frac{1+x}{1-x}\right|$ to show is an even function?
When dealing with strictly numbers, one defines the absolute value of $x$ as: $$|x| =\begin{cases} x, & x\geq 0, \\ -x, & x < 0. \\ \end{cases}$$
But we can't do that in this situation. I ask because I am working through a solution for the expression $$\int_{-\infty}^{\infty}\log\left|\frac{1+x}{1-x}\right| \frac{1}{x}dx = \pi^{2}$$
One of the steps is to establish that the integrand is even which I say I "somewhat" did:
$$f(-x) = \log\left|\frac{1-x}{1+x}\right|\frac{1}{-x} = (\log(1-x) - \log(1+x))\frac{1}{-x} = (\log(1+x) - \log(1-x))\frac{1}{x} = f(x) $$
But I am extremely wary of how I just "casually" dropped the absolute value signs. Because what I want to do is rewrite:
$$\int_{-\infty}^{\infty}\log\left|\frac{1+x}{1-x}\right| \frac{1}{x}dx = \int_{0}^{\infty}\log\left|\frac{1+x}{1-x}\right| \frac{1}{x}dx + \int_{-\infty}^{0}\log\left|\frac{1+x}{1-x}\right| \frac{1}{x}dx$$
And then flip the integral sign in the second term to $$\int_{0}^{\infty}\log\left|\frac{1+x}{1-x}\right| \frac{1}{x}dx$$ as well. But the step doesn't feel right to me in the same sense as if I was doing this to a number with absolute value bars which would have the following progression:
$$\int_{-\infty}^{\infty} |x| dx = \int_{0}^{\infty}x dx + \int_{-\infty}^{0}-x dx = \int_{0}^{\infty}x dx + \int_{0}^{\infty}x dx$$
So after all this the question remains: How do I "formally" handle this absolute value bars in the log to extract the same relationship?
This one is rather straight forward actually. When we say that the function is even, we mean
$$f(x)=f(-x)$$
and this can be seen clearly. Here we have
$$f(x)=\frac{1}{x}\log\left|\frac{1+x}{1-x}\right|$$
and thus
$$f(-x)=-\frac{1}{x}\log\left|\frac{1-x}{1+x}\right|$$
one of the Laws of Logarithms is that
$$A\log(x)=\log(x^A)$$
so if we let $A=-1$ here, we can write
$$f(-x)=\frac{1}{x}\log\left|\frac{1-x}{1+x}\right|^{-1}$$ $$=\frac{1}{x}\log\left|\frac{1+x}{1-x}\right|$$ $$=f(x)$$