Possible mistake in Apostol calculus: integration of the logarithm function

134 Views Asked by At

The exercise set 6.9 of calculus I Apostol lists the following to find the antiderivative:

$$a) \int \log^2(x)\;dx$$

The solution in the back of the book is:

$$b)\; x\log^2|x| - 2x\log|x| + 2x + C$$

I think that the answer should be the same, except all $\log|x| \rightarrow \log(x)$. By definition, we have $\log(x)$ and not $\log|x|$. It means that the logarithm $\log(x)$ under integration cannot accept any negative term. Hence, its antiderivative should not accept it either, because the derivative of (b) is $\log^2|x|$, which is clearly different to me than $\log^2(x)$. Is it a mistake in Apostol, or I do not understand something about the domains here?