Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The inconsistency I see between mathematical subjects is really confusing me. I understand that it isn't possible for $e^x$ to be less than zero for real $x$, which is probably why they say that the integral is $\ln(|x|)$.

Before I ramble on too much, I just want to ask: Is there a set of guidelines to follow to help me choose whether to let the integral of $\frac{1}{x}$ equal to $\ln(x)$ or $\ln(|x|)$?

Thanks, Aralox

share|cite|improve this question
And no: it is true that $\,e^x>0\,$ for all reals. – DonAntonio Nov 11 '12 at 3:25
Well @Aralox: you can write the argument of the logarithm (to any base) without the absolute value if you make clear, of if you're given, that the argument is positive, otherwise you must use the abs. value. You can drop this requirement if you work with the complex logarithm function, which perhaps you haven't yet studied. – DonAntonio Nov 11 '12 at 3:35
Yes! That's the answer I am looking for! I already understand that the abs brackets can be dropped if x is positive, but I was looking for more. I remember studying the principal logarithm a few months back, and understand that Ln(z) = ln|z| + iArg(z). Could you show me how to integrate 1/x using it? – Aralox Nov 11 '12 at 3:44
Hmm if I integrate 1, and get x + C, wouldnt f(x) = x + 5 for 1 < x < 4 and x + 15 elsewhere be perfectly valid too? i.e. just saying 'x + C' already implies that you can let C equal to whatever wherever you like? – Aralox Nov 11 '12 at 22:45
Once again, @RahulNarain: the moment you determine some conditions on the function you already determine the integration constant! I really can't understand what the problem here is...though perhaps I'm missing something, of course. – DonAntonio Nov 12 '12 at 3:26
up vote 16 down vote accepted

Strictly speaking, any function of the form $$F(x) = \begin{cases} \ln x + c_1 & \text{if } x > 0, \\ \ln (-x) + c_2 & \text{if } x <0 \end{cases}$$ defined over $\mathbb R \setminus \{0\}$ is a valid antiderivative. Verify this by differentiating $F(x)$ and getting $F'(x) = 1/x$ back for any $x \ne 0$.

The usual formula, $\ln\lvert x\rvert + c$, is what you get when you pick $c_1 = c_2 = c$. Alternatively, as @Joe says, when you're only considering positive $x$, you can just write $\ln x + c$.

share|cite|improve this answer
Bravo. Because the domain of $1/x$ consists of two connected components, the constant of integration must be allowed to be different on the two. Not to do so ignores the message and content of the theorem that tells us what the antiderivatives of a continuous function defined on an interval may be. – Lubin Nov 13 '12 at 3:57
and if you pick $c_2= c_1 + i \pi$ then you get the answer $\log z$ with the conventional branch choice of the complex logarithm. – Fabian Jul 7 '14 at 8:19
Also, if someone can explain what DonAntonio was trying to tell me in the comments on the question, I'd much appreciate it... It's hard to communicate on the internet. – Rahul Jan 11 '15 at 7:13

In general, it is safe to always write:

$$\int \frac{1}{u} \ du = \ln \left| u \right| +C $$ where $C$ is some constant.

However, if the function is always positive $\forall x \in \Bbb R\setminus \{0\}$ (assuming that's what you're integrating over), you can drop the absolute value.

Addendum of Complex Logarithm

I think this will be helpful since you wanted to know how to integrate with the complex log. Also, this should be a good read. I'd start around page 74 for what you're looking for.

I feel it might help to note that if we say $\log z$ is any logarithm along some branch $B$, then $(\log z)' = \dfrac{1}{z} \forall z$ not on $B.$ However, no matter how we define the complex logarithm, there will always be some branch that is not holomorphic.

share|cite|improve this answer
Thanks Joe! that almost immediately answered my question about how it its multivalued, and what exactly the 'principal value' means. Also, I had a read of the wikipedia article a few times, but I don't have a good grasp of what a branch is. Could you give it to me in simple terms? – Aralox Nov 11 '12 at 4:54
A branch is some portion of the range of a mutlivalued function in which the function is single-valued. A branch cut is a curve in $\Bbb C$ where a multifunction (a multivalued function) is discontinuous. For learning more about branch cuts, take a look at this question:… – Joe Nov 11 '12 at 5:35
Thanks again. Would I be right in saying that by limiting the Arg(z) in "Ln(z) = ln|z| + Arg(z)i" to (-pi, pi], that would be a branch? – Aralox Nov 11 '12 at 13:04

Equal to $\ln(|x|)$+c, in which $c$ is constant.

share|cite|improve this answer
@DonAntonio: I'd say that $\ln x+C$ makes little sense. Why choose the same constant for $x<0$ and $x>0$? (See Rahul's and countinghaus' answer.) – Hendrik Vogt Nov 11 '12 at 7:09
I've already addressed this question...and I find very weird that you keep on asking me the same under other people's answers. – DonAntonio Nov 12 '12 at 0:59
This is incomplete, if not incorrect. See Rahul's answer. – Pedro Tamaroff Jan 11 '15 at 8:04

The correct answer is$\int \frac1x dx= \ln |x| +C$

The absolute value is sometimes omitted in ODE problems. As for guidelines I would say analyze the problem and see if values of x will be out of the domain when solved.

share|cite|improve this answer
@DonAntonio: I'd say that $\ln x+C$ makes little sense. Why choose the same constant for $x<0$ and $x>0$? (See Rahul's and countinghaus' answer.) – Hendrik Vogt Nov 11 '12 at 7:08
I've already addressed this question. – DonAntonio Nov 12 '12 at 0:58
This is incomplete, if not incorrect. See Rahul's answer. – Pedro Tamaroff Jan 11 '15 at 8:04

I think the introduction of complex variables here is unnecessary. The function $1/x$ is a perfectly well-defined function on $\mathbb{R} \setminus \{0\}$ and we can ask if it has an antiderivative on that set. On the positive real axis, $\log(x)$ is an antiderivative. On the negative real axis, $\log(-x)$ is an antiderivative (and $\log(x)$ doesn't make sense). This is confusing, so we write $\log(|x|)$ so that we don't have to remember. Note that $\log(|x|) + C$ is not good notation, since the constant can be different on the negative and positive real axes.

share|cite|improve this answer

I remember studying the principal logarithm a few months back, and understand that Ln(z) = ln|z| + iArg(z). Could you show me how to integrate 1/x using it?

Right, and this is why the "most" correct answer is that $\ln(x)$ would be the antiderivative, considered as a function over the complex numbers (still not defined at zero). So that (as an example) one could use $\ln(-x)=\ln(x)+i\pi$ in the manner of Rahul's answer (with $c_2=i\pi$, which Euler wonderfully treats as a constant to ignore in some of his papers).

This has the problem that it's a multivalued function, but has the advantage that this enables one to choose a consistent branch to integrate over all sorts of interesting contours.

For instance, then the integral of $1/x$ over the unit circle (in $\mathbb{C}$) has to follow from $\ln(1)=0$ to $\ln(1)=2\pi i$ giving $2\pi i-0 = 2\pi i$, where I've here really followed the function up the Riemann surface, as it were - obviously not a function any more. Not how we usually think of the FTC, granted! But that really is the value of the contour integral.

See for one CAS' solution to this issue.

share|cite|improve this answer
Thank you, that makes so much sense. So in the end I can leave off the abs brackets if I state that my constant is in C rather than R. Could you please give me some examples of its multivalued nature? It's confusing me a little. Unfortunately I don't quite understand the curve integral/Riemann surface you described (although it sounds quite interesting, and I believe I am going to cover it in one of my future units). I have studied how to integrate these things using the sum of residues however. What does FTC stand for? – Aralox Nov 11 '12 at 4:50
@Aralox and kcrisman: I'm sorry to say this, but I think that this answer doesn't make so much sense. There's no $\ln x$ for negative $x$ in Rahul's answer, and $\ln(-x)=\ln x+i\pi$ is true only for certain branches of the complex logarithm. Moreover, $\ln x$ isn't the antiderivative, but only an antiderivative (cf. Rahul's answer). Finally, if I only look at the question, then taking about complex number only introduces unnecessary confusion here. I'd go with Rahul's answer, Aralox. – Hendrik Vogt Nov 11 '12 at 7:15
I can see how there should rightly be separate constants for the positive and negative real axis, and that this assumes that they are the same (like a few of the existing answers below). However kcrisman's answer gave me the complex viewpoint that I was looking for. If somehow I could combine his, Rahul's and Joe's answers together, it would be perfect. – Aralox Nov 11 '12 at 13:11
Actually I'm rethinking this again - the constant does take into account the pos/neg x axis if it is complex – Aralox Nov 11 '12 at 22:47
I'm not suggesting $\ln(-x)=\ln(x)+i\pi$ all the time, just that in Rahul's answer that's how one could interpret this. But I see how that could have been misinterpreted, so I'll edit the answer - thanks. – kcrisman Nov 13 '12 at 3:25

On the negative axis their difference is a constant. Both are antiderivatives.

share|cite|improve this answer
Hmm. As real functions only one is defined on the negative axis. As complex functions one is not holomorphic and thus cannot be an antiderivative. I don't see how to reconcile these facts with your answer. – Jyrki Lahtonen Jan 11 '15 at 10:37
$\log(x)$ on the negatives is the restriction of a holomorphic branch of $\log(z)$ on $\mathbb{C}\backslash\{0\}$, preferably mapping to $\mathcal{Im} \zeta = \pm \pi$ so it coincides on $(0,\infty)$ with the usual $\log$. For instance, $\log(-3) = \log 3 + i \pi$. The equality $\log(z)' = \frac{1}{z}$ ( for any branch one takes) is valid for complex derivatives so also for real derivatives. – orangeskid Jan 11 '15 at 11:01
I know what you mean. My point was that $\log(|z|)$ is nowhere holomorphic, and it wasn't IMO clear exactly which two functions you refer to, when you say Both are antiderivatives. – Jyrki Lahtonen Jan 11 '15 at 14:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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