Going through some old calculus exams, I find a solution to an integral via partial fraction decomposition. The solution manual does not perform full decomposition to avoid complex numbers, however; I did the decomposition with complex numbers.

$$\int\frac{1}{x+i}dx = ln(x+i)$$

The odd thing is that I first had a solution involving $ln(|x+i|)$. Graphing both solutions showed them to be quite dissimilar (the solution evaluates to reals). So I removed the absolute value bars from the logarithms containing an imaginary unit.


To my surprise, the graphs were equal (apart from a constant factor).

My question is why the absolute value bars are not needed, and what justifies them in the first place. I know that $ln(x), x = 0$ is undefined, but how can we justify the absolute value bars?

For reference, the exam question was to integrate the following: $$\int \frac{dx}{x^3+2x^2+2x}$$ The solution manual uses $$\frac{1}{2} \ln(|x|) - \frac{1}{4} \ln(x^2+2x+2) - \frac{1}{2}\arctan(x+1) + C_1$$
Whereas my solution came to: $$\frac{1}{2}\ln(|x|) + \frac{1}{-2i-2} \ln(x+1-i)+ \frac{1}{2i-2}\ln(x+1+i) + C_2$$

Where $i$ denotes the imaginary unit.

  • 2
    $\begingroup$ $\ln{x+i}$ is dangerous because it depends on the determination of the complex logarithm. Stick to real logarithm. In order to find the anti derivative of $1/x+i$ you write $1/x+i={x\over x^2+1}-{i \over x^2+1}$ $\endgroup$ – marwalix Sep 26 '15 at 10:47
  • 1
    $\begingroup$ Please think until you understand: The function $\ln(|z|)$ is not a differentiable function of the complex variable $z$. So $\ln(|z|)$ is wrong if you are asked for the antiderivative of $1/z$, a function of a complex variable $z$. $\endgroup$ – GEdgar Sep 14 '19 at 13:51

It's unfortunate that people learn $\ln |x|$ as an antiderivative for $1/x$ in calculus, because this will not work in a complex context. What is true in general is that $\ln (C x)$ is an antiderivative for $1/x$ where $C$ is nonzero and locally constant. In a real-variable context, if you want to avoid logarithms of negative numbers, you can take $C$ to be negative when $x$ is negative, and positive when $x$ is positive. This doesn't cause a problem because $x > 0$ and $x < 0$ are disjoint intervals. There's really no reason to expect the $C$ for $x < 0$ and the $C$ for $x > 0$ to be related.

In the complex case, introducing absolute values will almost always spoil analyticity, and indeed $\ln |z|$ is not an analytic function. The best you can say is that given any branch of $\ln$ defined on a domain $D$, $\ln(C z)$ is an antiderivative for $1/z$ on $\{z: C z \in D\}$.


$\newcommand{\Ln}{\operatorname{Ln}}$ In this case you should write $\Ln(x+i)$ for the main branch of the complex logarithm. Note that $$ \Ln(x+i)=\ln(|x+i|)+i·\arg(x+i)=\tfrac12·\ln(1+x^2)+i·(\tfrac\pi2-\arctan(x)+k·2\pi). $$

As such, your solution further transforms to \begin{align} &=\frac12\ln|x|-\frac{1-i}4\Ln(x+1-i)-\frac{1+i}4\Ln(x+1+i)+C_2 \\ &=\frac12\ln|x|-\frac12\Re\Bigl((1+i)(\ln|x+1+i|+i\arg(x+1+i)\Bigr)+C_2 \\ &=\frac12\ln|x|-\frac14\ln((x+1)^2+1)+\frac12\left(\frac\pi2-\arctan(x+1)\right)+C_2 \end{align}


You need to think of $\ln(y)$ as a function that solves the equation $y = e^x$ for x. It becomes readily apparent that there are an infinite amount of possible solutions for a complex x, as euler's formula states:

$$ e^{ix} = \cos(x) + i\sin(x) $$

This implies that any multiple of the imaginary unit will have its real part plus a full cycle: ($n \in \mathbb{Z}$)

$$ x = ln|y| + 2i n\pi $$

For any negative y, you need to rotate in the complex plane by 180 degrees, this means an odd multiple of pi:

$$ y \in \mathbb{R^-} \Rightarrow x = ln|y| + (2n-1)i\pi \Rightarrow |y|e^{(2n-1)i\pi} = -|y| $$

Taking any integral on the negative side of the $x^{-1}$ function from a to b, where $a < b$, results in the following:

$$(ln|b| + (2n-1)i\pi) - (ln|a| + (2n-1)i\pi)$$ $$ \Rightarrow ln|b| - ln|a| $$

Peculiar occurrences happen when taking the integral over the interval where it is discontinuous (at zero):

$$ \int_{-a}^a x^{-1}dx, a \in \mathbb{R^+} = (ln(a) + 2in\pi) - (ln(a) + i(2n-1)\pi)$$ $$ = 2in\pi - 2in\pi + i\pi = i\pi $$

This answer makes no sense, and is invalid as it was integrated over a discontinous interval (hence not Riemann integrable). To remedy this problem, you need to observe that $x^{-1}$ is an odd function. Using our intuition we observe that any areas generated by the negative side of the graph will cancel out an equal portion on the right side. Hence, to allow the answer to make sense we can take the absolute values.

$$ \int_{-a}^a x^{-1}dx, a \in \mathbb{R^+} = ln|a| - ln|a| = 0$$

The reason absolute value bars are invalid for complex numbers is because the point never passes through zero (and thus gives us no excuse to look at symmetry, as there is no symmetry):

$$ \int_{-a}^a (x+i)^{-1}dx, a \in \mathbb{R^+} $$

$(x+i)^{-1}$ is fully Riemann integrable, as the function is continuous for all $x \in \mathbb{R}$.

Conclusion: the reals of $x^{-1}$ is discontinuous at zero, and special care must be taken. We exploit symmetry to construct the correct expression for the area.

  • $\begingroup$ This answer is awaiting criticism, as it is answered by the asker, whilst being speculative. $\endgroup$ – Ultimate Hawk Sep 30 '15 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.